| expcov | R Documentation |
Computes the exponential covariance matrix.
expcov(edists, rho, sigma2)
edists |
Numeric matrix ( |
rho |
Positive numeric scalar. Length-scale parameter |
sigma2 |
Positive numeric scalar. Signal variance parameter |
The covariance function is defined as:
C_{i,j} = \sigma^2 \exp(-d_{i,j} / \rho)
where d_{ij} is the distance between locations i and j.
Larger values of \rho imply slower decay of correlation with distance
(i.e., stronger spatial autocorrelation). Larger values of \sigma^2
increase the marginal variance of the process.
A small nugget term (1e-6) is added to the diagonal for numerical stability.
A numeric matrix (M \times M) representing the covariance between spatial locations.
Fabian Ketwaroo
coords <- matrix(runif(10), ncol = 2)
d <- as.matrix(dist(coords))
expcov(edists = d, rho = 0.5, sigma2 = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.