.\" -*- nroff -*- generated from .Rd format
.BG
.FN matern
.TL
Computer Values of the Matern Correlation Function
.DN
This function computes the values of the Matern correlation function
for given distances and parameters.
.CS

matern(u, phi, kappa)

.RA
.AG u
a vector, matrix or array with distances between data points.
.AG phi
value of the range parameter phi.
.AG kappa
value of the smoothness parameter kappa.
.RT
A vector matrix or array, according to the argument `u', with the
values of the Matern correlation function for the given distances.
.SH REFERENCES
Further information about `geoR/geoS' can be found at:
.br
<URL: http://www.maths.lancs.ac.uk/~ribeiro/geoR.html>
.SA
`cov.spatial',`besselK'.
.EX
dval <- seq(0,1,l=101)
#
# Models with fixed range and varying smoothness parameter
#
mat.5 <-  matern(dval, phi = .25, kappa = 0.5)
mat1 <-  matern(dval, phi = .25, kappa = 1)
mat2 <-  matern(dval, phi = .25, kappa = 2)
mat3 <-  matern(dval, phi = .25, kappa = 3)
plot(0:1, 0:1, type="n", xlab="distance", ylab=expression(rho(h)),
main=expression(paste("varying  ", kappa, "  and fixed  ", phi)))
lines(dval, mat.5, lty=2)
lines(dval, mat1)
lines(dval, mat2, lwd=2, lty=2)
lines(dval, mat3, lwd=2)
legend(0.6,1, c(expression(kappa == 0.5), expression(kappa == 1),
    expression(kappa == 2), expression(kappa == 3)),
    lty=c(2,1,2,1), lwd=c(1,1,2,2))
#
# Correlations with equivalent "practical range"
# and varying smoothness parameter
#
mat.5 <-  matern(dval, phi = .25, kappa = 0.5)
mat1 <-  matern(dval, phi = .188, kappa = 1)
mat2 <-  matern(dval, phi = .140, kappa = 2)
mat3 <-  matern(dval, phi = .117, kappa = 3)
plot(0:1, 0:1, type="n", xlab="distance", ylab=expression(rho(h)),
    main="models with the equivalent \"practical\" range")
lines(dval, mat.5, lty=2)
lines(dval, mat1)
lines(dval, mat2, lwd=2, lty=2)
lines(dval, mat3, lwd=2)
legend(0.5,1, c(expression(paste(kappa == 0.5, "  and  ",
    phi == 0.250)),
    expression(paste(kappa == 1, "  and  ", phi == 0.188)),
    expression(paste(kappa == 2, "  and  ", phi == 0.140)),
    expression(paste(kappa == 3, "  and  ", phi == 0.117))),
    lty=c(2,1,2,1), lwd=c(1,1,2,2))

.KW spatial
.WR
