Periodic kernel

class gp.kernels.periodic.PeriodicKernel(h, w, p)[source]

Bases: gp.kernels.base.Kernel

Periodic kernel function.

Parameters :

h : float

Output scale kernel parameter

w : float

Input scale kernel parameter

p : float

Period kernel parameter

Notes

The periodic kernel is defined by Equation 4.31 of [RW06]:

\[K(x_1, x_2) = h^2\exp\left(\frac{-2\sin^2\left(\frac{x_1-x_2}{2p}\right)}{w^2}\right)\]

where \(w\) is the input scale parameter (equivalent to the standard deviation of the Gaussian), \(h\) is the output scale parameter, and \(p\) is the period kernel parameter.

K(x1, x2, out=None)[source]

Kernel function evaluated at x1 and x2.

Parameters :

x1 : numpy.ndarray with dtype='f8'

\(n\)-length vector

x2 : numpy.ndarray with dtype='f8'

\(m\)-length vector

Returns :

K : numpy.ndarray

\(n\times m\) array

copy()

Create a copy of the kernel.

Returns :

kernel : Kernel

New kernel function object of type type(self).

d2K_dhdh(x1, x2, out=None)[source]
d2K_dhdp(x1, x2, out=None)[source]
d2K_dhdw(x1, x2, out=None)[source]
d2K_dpdh(x1, x2, out=None)[source]
d2K_dpdp(x1, x2, out=None)[source]
d2K_dpdw(x1, x2, out=None)[source]
d2K_dwdh(x1, x2, out=None)[source]
d2K_dwdp(x1, x2, out=None)[source]
d2K_dwdw(x1, x2, out=None)[source]
dK_dh(x1, x2, out=None)[source]
dK_dp(x1, x2, out=None)[source]
dK_dw(x1, x2, out=None)[source]
h = None

Output scale kernel parameter

hessian(x1, x2, out=None)[source]

Hessian of the kernel function evaluated at x1 and x2.

Parameters :

x1 : numpy.ndarray with dtype='f8'

\(n\)-length vector

x2 : numpy.ndarray with dtype='f8'

\(m\)-length vector

Returns :

H : numpy.ndarray

\(n_p\times n_p\times n\times m\) array, where \(n_p\) is the number of kernel parameters. See params.

jacobian(x1, x2, out=None)[source]

Jacobian of the kernel function evaluated at x1 and x2.

Parameters :

x1 : numpy.ndarray with dtype='f8'

\(n\)-length vector

x2 : numpy.ndarray with dtype='f8'

\(m\)-length vector

Returns :

J : numpy.ndarray

\(n_p\times n\times m\) array, where \(n_p\) is the number of kernel parameters. See params.

p = None

Period kernel parameter

params[source]

Kernel parameters.

Returns :params : numpy.ndarray (h, w, p)
set_param(name, val)[source]
sym_K[source]

Symbolic kernel function.

Returns :

K : sympy.Expr

A sympy expression representing the symbolic form of the kernel function.

w = None

Input scale kernel parameter

Previous topic

Gaussian kernel

Next topic

Kernel base class

This Page