View source: R/AuxiliaryFunctions_USER.R
CovMat | R Documentation |
It computes the spatial variance-covariance matrix considering exponential, gaussian, matérn, or power exponential correlation function.
CovMat(phi, tau2, sig2, coords, type = "exponential", kappa = NULL)
phi |
spatial scaling parameter. |
tau2 |
nugget effect parameter. |
sig2 |
partial sill parameter. |
coords |
2D spatial coordinates of dimensions n\times 2. |
type |
type of spatial correlation function: |
kappa |
parameter for some spatial correlation functions. For exponential
and gaussian |
The spatial covariance matrix is given by
Σ = [Cov(s_i, s_j )] = σ^2 R(φ) + τ^2 I_n,
where σ^2 > 0 is the partial sill, φ > 0 is the spatial scaling parameter, τ^2 > 0 is known as the nugget effect in the geostatistical framework, R(φ) is the n\times n correlation matrix computed from a correlation function, and I_n is the n\times n identity matrix.
The spatial correlation functions available are:
Corr(d) = exp(-d/φ),
Corr(d) = exp(-(d/φ)^2),
Corr(d) = \frac{1}{2^{(κ-1)}Γ(κ)}≤ft(\frac{d}{φ}\right)^κ K_κ ≤ft( \frac{d}{φ} \right),
Corr(d) = exp(-(d/φ)^κ),
where d ≥q 0 is the Euclidean distance between two observations, Γ(.) is the gamma function, κ is the smoothness parameter, and K_κ(.) is the modified Bessel function of the second kind of order κ.
An n\times n spatial covariance matrix.
Katherine L. Valeriano, Alejandro Ordoñez, Christian E. Galarza, and Larissa A. Matos.
dist2Dmatrix
, EM.sclm
, MCEM.sclm
, SAEM.sclm
set.seed(1000) n = 20 coords = round(matrix(runif(2*n, 0, 10), n, 2), 5) Cov = CovMat(phi=5, tau2=0.8, sig2=2, coords=coords, type="exponential")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.