https://github.com/cran/fields
Tip revision: 6769ffc81115fbf0bf7d9c566cf7ac81be0049dc authored by Doug Nychka on 25 July 2005, 00:00:00 UTC
version 3.04
version 3.04
Tip revision: 6769ffc
Exponential.R
"Exponential" <-
function (d , range = 1, alpha=1/range, phi=1)
{
#
# Matern covariance function transcribed from Stein's book page 31
# nu==smoothness==.5, alpha == 1/range
#
# GeoR parameters map to kappa==smoothness and phi == range
# check for negative distances
if( any( d <0)) stop("distance argument must be nonnegative")
d<- d*alpha
#
return( phi*ifelse( d>0, exp(-d), 1) )
}