https://github.com/cran/fields
Tip revision: ce722edae3c1b9e1af2985ce3500b11058facf0e authored by Doug Nychka on 24 August 2006, 01:46:17 UTC
version 3.04
version 3.04
Tip revision: ce722ed
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) )
}