Learn R Programming

rkriging (version 1.0.2)

Matern.Kernel: Generalized Matern Kernel

Description

This function specifies the (Generalized) Matern kernel with any smoothness parameter \(\nu\).

Usage

Matern.Kernel(lengthscale, nu = 2.01)

Value

A Generalized Matern Kernel Class Object.

Arguments

lengthscale

a vector for the positive length scale parameters

nu

a positive scalar parameter that controls the smoothness

Author

Chaofan Huang and V. Roshan Joseph

Details

The Generalized Matern kernel is given by $$k(r;\nu)=\frac{2^{1-\nu}}{\Gamma(\nu)}(\sqrt{2\nu}r)^{\nu}K_{\nu}(\sqrt{2\nu}r),$$ where \(\nu\) is the smoothness parameter, \(K_{\nu}\) is the modified Bessel function, \(\Gamma\) is the gamma function, and $$r(x,x^{\prime})=\sqrt{\sum_{i=1}^{p}\left(\frac{x_{i}-x_{i}^{\prime}}{l_{i}}\right)^2}$$ is the euclidean distance between \(x\) and \(x^{\prime}\) weighted by the length scale parameters \(l_{i}\)'s. As \(\nu\to\infty\), it converges to the Gaussian.Kernel.

References

Duvenaud, D. (2014). The kernel cookbook: Advice on covariance functions.

Rasmussen, C. E. & Williams, C. K. (2006). Gaussian Processes for Machine Learning. The MIT Press.

See Also

Matern12.Kernel, Matern32.Kernel, Matern52.Kernel, MultiplicativeMatern.Kernel, Get.Kernel, Evaluate.Kernel.

Examples

Run this code
n <- 5
p <- 3
X <- matrix(rnorm(n*p), ncol=p)
lengthscale <- c(1:p)

# approach 1
kernel <- Matern.Kernel(lengthscale, nu=2.01)
Evaluate.Kernel(kernel, X)

# approach 2
kernel <- Get.Kernel(lengthscale, type="Matern", parameters=list(nu=2.01))
Evaluate.Kernel(kernel, X) 

Run the code above in your browser using DataLab