Get.Kernel {rkriging} | R Documentation |
Kernel
Description
This function provides a common interface to specify various kernels. See arguments section for the available kernels in this package.
Usage
Get.Kernel(lengthscale, type, parameters = list())
Arguments
lengthscale |
a vector for the positive length scale parameters |
type |
kernel type: Gaussian, RQ, Matern12, Matern32, Matern52, Matern, UDF, MultiplicativeRQ, MultiplicativeMatern, MultiplicativeUDF |
parameters |
a list of parameters required for the specific kernel |
Value
A Kernel Class Object.
Author(s)
Chaofan Huang and V. Roshan Joseph
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
Evaluate.Kernel, Gaussian.Kernel, RQ.Kernel, Matern12.Kernel, Matern32.Kernel, Matern52.Kernel Matern.Kernel, UDF.Kernel, MultiplicativeRQ.Kernel, MultiplicativeMatern.Kernel, MultiplicativeUDF.Kernel.
Examples
n <- 5
p <- 3
X <- matrix(rnorm(n*p), ncol=p)
lengthscale <- c(1:p)
# Gaussian
kernel <- Get.Kernel(lengthscale, type="Gaussian")
Evaluate.Kernel(kernel, X)
# Rational Quadratic (RQ)
kernel <- Get.Kernel(lengthscale, type="RQ", parameters=list(alpha=1))
Evaluate.Kernel(kernel, X)
# Matern(1/2)
kernel <- Get.Kernel(lengthscale, type="Matern12")
Evaluate.Kernel(kernel, X)
# Matern(3/2)
kernel <- Get.Kernel(lengthscale, type="Matern32")
Evaluate.Kernel(kernel, X)
# Matern(5/2)
kernel <- Get.Kernel(lengthscale, type="Matern52")
Evaluate.Kernel(kernel, X)
# Generalized Matern
kernel <- Get.Kernel(lengthscale, type="Matern", parameters=list(nu=2.01))
Evaluate.Kernel(kernel, X)
# User Defined Function (UDF) Kernel
kernel.function <- function(sqdist) {return (exp(-sqrt(sqdist)))}
kernel <- Get.Kernel(lengthscale, type="UDF",
parameters=list(kernel.function=kernel.function))
Evaluate.Kernel(kernel, X)
# Multiplicative Rational Quadratic (RQ)
kernel <- Get.Kernel(lengthscale, type="MultiplicativeRQ", parameters=list(alpha=1))
Evaluate.Kernel(kernel, X)
# Multiplicative Generalized Matern
kernel <- Get.Kernel(lengthscale, type="MultiplicativeMatern", parameters=list(nu=2.01))
Evaluate.Kernel(kernel, X)
# Multiplicative User Defined Function (UDF)
kernel.function <- function(sqdist) {return (exp(-sqrt(sqdist)))}
kernel <- Get.Kernel(lengthscale, type="MultiplicativeUDF",
parameters=list(kernel.function=kernel.function))
Evaluate.Kernel(kernel, X)