Learn R Programming

fdars (version 0.3.3)

kernel.gaussian: Gaussian (Squared Exponential) Covariance Function

Description

Computes the Gaussian (RBF/squared exponential) covariance function: $$k(s, t) = \sigma^2 \exp\left(-\frac{(s-t)^2}{2\ell^2}\right)$$

Usage

kernel.gaussian(variance = 1, length_scale = 1)

Value

A covariance function object of class 'kernel_gaussian'.

Arguments

variance

Variance parameter \(\sigma^2\) (default 1).

length_scale

Length scale parameter \(\ell\) (default 1).

Details

This kernel produces infinitely differentiable (very smooth) sample paths.

The Gaussian covariance function, also known as the squared exponential or radial basis function (RBF) kernel, is one of the most commonly used covariance functions. It produces very smooth sample paths because it is infinitely differentiable.

The length scale parameter controls how quickly the correlation decays with distance. Larger values produce smoother, more slowly varying functions.

See Also

kernel.exponential, kernel.matern, make.gaussian.process

Examples

Run this code
# Create a Gaussian covariance function
cov_func <- kernel.gaussian(variance = 1, length_scale = 0.2)

# Evaluate covariance matrix on a grid
t <- seq(0, 1, length.out = 50)
K <- cov_func(t)
image(K, main = "Gaussian Covariance Matrix")

# Generate Gaussian process samples
fd <- make.gaussian.process(n = 10, t = t, cov = cov_func)
plot(fd)

Run the code above in your browser using DataLab