Skip to contents

Computes the polynomial covariance function: $$k(s, t) = \sigma^2 (s \cdot t + c)^p$$

Usage

kernel.polynomial(variance = 1, offset = 0, degree = 2)

Arguments

variance

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

offset

Offset parameter \(c\) (default 0).

degree

Polynomial degree \(p\) (default 2).

Value

A covariance function object of class 'kernel_polynomial'.

Details

The polynomial covariance function produces sample paths that are polynomial functions of degree at most degree. Setting degree = 1 and offset = 0 gives the linear kernel.

Examples

# Generate quadratic function samples
cov_func <- kernel.polynomial(degree = 2, offset = 1)
t <- seq(0, 1, length.out = 50)
fd <- make.gaussian.process(n = 10, t = t, cov = cov_func)
plot(fd)