Description Usage Arguments Value Parametrization Examples
From a location matrix (locs
) and a vector with covariance parameters (covparms
), this function returns an anisotropic exponential covariance matrix.
1 | cov_expo_aniso(locs, covparms)
|
locs |
A matrix with |
covparms |
A vector with covariance parameters in the form (variance, range, degree of anisotropy) |
A matrix with n
rows and n
columns, with the (i, j) entry containing the anisotropic exponenital covariance between observations locs[i, ]
and locs[j, ]
The covariance parameter vector is (variance, range, degree of anisotropy) = (σ^2 , r, α). The form of the covariance is
C(x, y) = σ^2 exp( || A ( x - y ) || / r)
where x and y are locations in R^p and A is a diagonal matrix diag( √ α , 1 , ... , 1 ).
1 2 3 4 5 | # grid locations
cov_expo_aniso(locs = expand.grid(c(0.25, 0.75), c(0.25, 0.75)), covparms = c(1, 0.1, 10))
# randomly selected locations
cov_expo_aniso(locs = matrix(runif(8), 4, 2), covparms = c(1, 0.1, 10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.