CovMat {RcppCensSpatial} | R Documentation |
Covariance matrix for spatial models
Description
It computes the spatial variance-covariance matrix considering exponential, gaussian, matérn, or power exponential correlation function.
Usage
CovMat(phi, tau2, sig2, coords, type = "exponential", kappa = NULL)
Arguments
phi |
spatial scaling parameter. |
tau2 |
nugget effect parameter. |
sig2 |
partial sill parameter. |
coords |
2D spatial coordinates of dimensions |
type |
type of spatial correlation function: |
kappa |
parameter for some spatial correlation functions. For exponential
and gaussian |
Details
The spatial covariance matrix is given by
\Sigma = [Cov(s_i, s_j )] = \sigma^2 R(\phi) + \tau^2 I_n
,
where \sigma^2 > 0
is the partial sill, \phi > 0
is the spatial scaling
parameter, \tau^2 > 0
is known as the nugget effect in the geostatistical
framework, R(\phi)
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:
- Exponential:
Corr(d) = exp(-d/\phi)
,- Gaussian:
Corr(d) = exp(-(d/\phi)^2)
,- Matérn:
Corr(d) = \frac{1}{2^{(\kappa-1)}\Gamma(\kappa)}\left(\frac{d}{\phi}\right)^\kappa K_\kappa \left( \frac{d}{\phi} \right)
,- Power exponential:
Corr(d) = exp(-(d/\phi)^\kappa)
,
where d \geq 0
is the Euclidean distance between two observations,
\Gamma(.)
is the gamma function, \kappa
is the smoothness parameter,
and K_\kappa(.)
is the modified Bessel function of the second kind of order
\kappa
.
Value
An n\times n
spatial covariance matrix.
Author(s)
Katherine L. Valeriano, Alejandro Ordoñez, Christian E. Galarza, and Larissa A. Matos.
See Also
dist2Dmatrix
, EM.sclm
, MCEM.sclm
, SAEM.sclm
Examples
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")