Skip to contents

Kernel specifications are reusable objects that store covariance parameters separately from the observations on which they are evaluated. They are the building blocks for composite kernels and later Gaussian-process fitting.

Usage

rbf_kernel(variance = 1, length_scale = 1)

Arguments

variance

Positive marginal variance.

length_scale

Positive scalar or numeric vector. A vector supplies one ARD length scale per input dimension and is validated against the data when the kernel is evaluated.

Value

An object of class gaussianprocesses_kernel.

Stability

Stable: from version 1.0.0 this interface changes incompatibly only in a major release, after a deprecation period. Results and options that concern an experimental model class, kernel, or argument follow that interface's tier. See gaussianprocesses-package for the policy.

See also

kernel_rbf() computes the same covariance directly from parameter values, without a kernel specification.

Examples

kernel <- rbf_kernel(variance = 1.5, length_scale = c(0.5, 2))
kernel
#> RBF(variance=1.5, length_scale=c(0.5, 2))

evaluate_kernel(kernel, cbind(c(0, 1), c(0, 1)))
#>           [,1]      [,2]
#> [1,] 1.5000000 0.1791495
#> [2,] 0.1791495 1.5000000