spaMM (version 2.1.6)

MaternCorr: Matern correlation function and Matern formula term.

Description

The Mat<U+00E9>rn correlation function describes realizations of Gaussian spatial processes with different smoothnesses (i.e. either smooth or rugged surfaces). It also includes a scaling and a 'nugget' parameter. It can be invoked in two ways. First, the MaternCorr function evaluates these correlations, using distances as input. Second, a term of the form Matern(1|<...>) in a formula specifies a random effect with Mat<U+00E9>rn correlation function, using coordinates found in a data frame as input. In the latter case, the correlations between realizations of the random effect for any two observations in the data will be the value of the Mat<U+00E9>rn function at the scaled Euclidean distance between coordinates specified in <...>, using “+” as separator (e.g., Matern(1|latitude + longitude)).

Usage

# S3 method for default
MaternCorr(d, rho = 1, smoothness, nu = smoothness, Nugget = 0L)
# Matern(1|...)

Arguments

d

A distance, typically an Euclidean distance

rho

A scaling factor for distance. The 'range' considered in some formulations is the reciprocal of this scaling factor

smoothness

The smoothness parameter, >0. \(\nu=0.5\) corresponds to the exponential correlation function, and the limit function when \(\mu\) goes to \(\infty\) is the squared exponential function (as in a Gaussian).

nu

Same as smoothness

Nugget

(Following the jargon of Kriging) a parameter describing a discontinuous decrease in correlation at zero distance. Correlation will always be 1 at \(d=0\), and from which it immediately drops to (1-Nugget)

...

Names of coordinates, using “+” as separator (e.g., Matern(1|latitude + longitude)

Value

Scalar/vector/matrix depending on input.

Details

The correlation at distance \(d>0\) is $$(1-\textrm{Nugget}) \frac{(\rho d)^\nu K_\nu(\rho d)}{2^{(\nu - 1)} \Gamma(\nu)}$$ where \(K_\nu\) is the besselK function of order \(\nu\).

References

Stein, M.L. (1999) Statistical Interpolation of Spatial Data: Some Theory for Kriging. Springer, New York.

See Also

See corMatern for an implementation of this correlation function as a corSpatial object for use with lme or glmmPQL.

By default the Nugget is set to 0. See one of the examples on data set Loaloa for a fit including the estimation of the Nugget.

Examples

Run this code
# NOT RUN {
## See examples in help("spaMM"), help("HLCor"), help("Loaloa"), etc.
## The Mat<U+00E9>rn function can be used in Euclidean spaces of any dimension:
set.seed(123)
randpts <- matrix(rnorm(20),nrow=5)
distMatrix <- as.matrix(proxy::dist(randpts))
MaternCorr(distMatrix,nu=2)
# }

Run the code above in your browser using DataCamp Workspace