50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

geoR (version 1.7-5.2.1)

matern: Computer Values of the Matern Correlation Function

Description

This function computes values of the Mat\'{e}rn correlation function for given distances and parameters.

Usage

matern(u, phi, kappa)

Arguments

u

a vector, matrix or array with values of the distances between pairs of data locations.

phi

value of the range parameter ϕ.

kappa

value of the smoothness parameter κ.

Value

A vector matrix or array, according to the argument u, with the values of the Mat\'{e}rn correlation function for the given distances.

Details

The Mat\'{e}rn model is defined as:

ρ(u;ϕ,κ)={2κ1Γ(κ)}1(u/ϕ)κKκ(u/ϕ)

where ϕ and κ are parameters and Kκ() denotes the modified Bessel function of the third kind of order κ. The family is valid for ϕ>0 and κ>0.

See Also

cov.spatial for the correlation functions implemented in geoR, and besselK for computation of the Bessel functions.

Examples

Run this code
# NOT RUN {
#
# Models with fixed range and varying smoothness parameter
#
curve(matern(x, phi= 0.25, kappa = 0.5),from = 0, to = 1.5,
      xlab = "distance", ylab = expression(rho(h)), lty = 2,
      main=expression(paste("varying  ", kappa, "  and fixed  ", phi)))
curve(matern(x, phi= 0.25, kappa = 1),from = 0, to = 1.5, add = TRUE)
curve(matern(x, phi= 0.25, kappa = 2),from = 0, to = 1.5, add = TRUE,
      lwd = 2, lty=2)
curve(matern(x, phi= 0.25, kappa = 3),from = 0, to = 1.5, add = TRUE,
      lwd = 2)
legend("topright", expression(kappa==0.5, kappa==1.5, kappa==2, kappa==3),
    lty=c(2,1,2,1), lwd=c(1,1,2,2))

#
# Correlations with equivalent "practical range"
# and varying smoothness parameter
#
curve(matern(x, phi = 0.25, kappa = 0.5),from = 0, to = 1,
      xlab = "distance", ylab = expression(gamma(h)), lty = 2,
      main = "models with equivalent \"practical\" range")
curve(matern(x, phi = 0.188, kappa = 1),from = 0, to = 1, add = TRUE)      
curve(matern(x, phi = 0.14, kappa = 2),from = 0, to = 1,
      add = TRUE, lwd=2, lty=2)      
curve(matern(x, phi = 0.117, kappa = 2), from = 0, to = 1,
      add = TRUE, lwd=2)      
legend("topright", expression(list(kappa == 0.5, phi == 0.250),
       list(kappa == 1, phi == 0.188), list(kappa == 2, phi == 0.140),
       list(kappa == 3, phi == 0.117)), lty=c(2,1,2,1), lwd=c(1,1,2,2))
# }

Run the code above in your browser using DataLab