kernels {bases}R Documentation

Kernel functions

Description

These functions return vectorized kernel functions that can be used to calculate kernel matrices, or provided directly to other basis functions. These functions are designed to take a maximum value of one when identical inputs are provided. Kernels can be combined with arithmetic expressions; see ?kernel-arith.

Usage

k_rbf(scale = 1)

k_lapl(scale = 1)

k_rq(scale = 1, alpha = 2)

k_matern(scale = 1, nu = 1.5)

k_per(scale = 1, period = 1)

Arguments

scale

The kernel length scale.

alpha

The shape/df parameter. \alpha=1 is the Cauchy kernel.

nu

The smoothness parameter. \nu=0.5 is the Ornstein–Uhlenbeck kernel.

period

The period, in the same units as scale.

Value

A function which calculates a kernel matrix for vector arguments x and y. The function has class c("kernel", "function").

Functions

Examples

k = k_rbf()
x = seq(-1, 1, 0.5)
k(0, 0)
k(0, x)
k(x, x)

k = k_per(scale=0.2, period=0.3)
round(k(x, x))


[Package bases version 0.1.2 Index]