CovMat: Covariance matrix for spatial models

View source: R/AuxiliaryFunctions_USER.R

CovMatR 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 n\times 2.

type

type of spatial correlation function: 'exponential', 'gaussian', 'matern', and 'pow.exp' for exponential, gaussian, matérn, and power exponential, respectively.

kappa

parameter for some spatial correlation functions. For exponential and gaussian kappa=NULL, for power exponential 0 < kappa <= 2, and for matérn correlation function kappa > 0.

Details

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:

Exponential:

Corr(d) = exp(-d/φ),

Gaussian:

Corr(d) = exp(-(d/φ)^2),

Matérn:

Corr(d) = \frac{1}{2^{(κ-1)}Γ(κ)}≤ft(\frac{d}{φ}\right)^κ K_κ ≤ft( \frac{d}{φ} \right),

Power exponential:

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 κ.

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")

RcppCensSpatial documentation built on June 28, 2022, 1:07 a.m.