Skip to content

covfunc

This module provides covariance functions for the nodes and weights of the GPRN.

covFunction(*args)

Base class for covariance functions (kernels) used for nodes and weights in the GPRN.

Sum

Bases: _operator

Sum of two covariance functions

Multiplication

Bases: _operator

Product of two covariance functions

Constant(c)

Bases: covFunction

This kernel returns the square of its constant argument c $$ K_{ij} = c^2 $$

Parameters:

Name Type Description Default
c float

Constant value

required

WhiteNoise(w)

Bases: covFunction

White noise (diagonal) kernel $$ K_{ij} = w^2 \, \delta_{ij} $$

Parameters:

Name Type Description Default
w float

White noise amplitude

required

SquaredExponential(theta, ell)

Bases: covFunction

Squared Exponential kernel, also known as radial basis function $$ K_{ij} = \theta^2 \, \exp \left[ - \frac{(t_i - t_j)^2}{2 \ell^2} \right] $$

Parameters:

Name Type Description Default
theta float

Amplitude

required
ell float

Length-scale

required

Periodic(theta, P, ell)

Bases: covFunction

Periodic kernel, also known as the exponential sine squared $$ K_{ij} = \theta^2 \, \exp \left[ - \frac{2 \sin^2 \left( \frac{\pi (t_i - t_j)}{P} \right)}{\ell^2} \right] $$

Parameters:

Name Type Description Default
theta float

Amplitude

required
P float

Period

required
ell float

Lenght scale

required
Parameterization

Note that the periodic kernel is sometimes parameterized differently, namely using \(\Gamma = 2/\ell^2\).

QuasiPeriodic(theta, elle, P, ellp)

Bases: covFunction

This kernel is the product between the periodic kernel and the squared exponential kernel, and is commonly known as the quasi-periodic kernel $$ K_{ij} = \theta^2 \, \exp \left[ - \frac{(t_i - t_j)^2}{2 \ell_e^2} - \frac{2 \sin^2 \left( \frac{\pi (t_i - t_j)}{P} \right)}{\ell_p^2} \right] $$

Parameters:

Name Type Description Default
theta float

Amplitude

required
elle float

Evolutionary length scale

required
P float

Kernel periodicity

required
ellp float

Length scale of the periodic component

required
Info

The QuasiPeriodic kernel is implemented on its own for convenience, but it is exactly equivalent to the product of a SquaredExponential and a Periodic kernel with the same parameters.

RationalQuadratic(theta, alpha, ell)

Bases: covFunction

The rational quadratic kernel $$ $$

Parameters:

Name Type Description Default
theta float

Amplitude of the kernel

required
alpha float

Amplitude of large and small scale variations

required
ell float

Characteristic lenght scale to define the kernel "smoothness"

required

RQP(theta, alpha, elle, P, ellp)

Bases: covFunction

Product between the periodic kernel and the rational quadratic kernel that we call RQP kernel.

Parameters:

Name Type Description Default
theta float

Amplitude

required
alpha float

Alpha of the rational quadratic kernel

required
elle float

Aperiodic length scale

required
P float

Periodic repetitions of the kernel

required
ellp float

Periodic length scale

required

Cosine(theta, P)

Bases: covFunction

the cosine kernel

Parameters:

Name Type Description Default
theta float

Amplitude

required
P float

Period

required

Exponential(theta, ell)

Bases: covFunction

The exponential kernel $$ K_{ij} = \theta^2 \, \exp \left( - \frac{|t_i - t_j|}{\ell} \right) $$

Parameters:

Name Type Description Default
theta float

Amplitude

required
ell float

Characteristic lenght scale

required

Matern32(theta, ell)

Bases: covFunction

the Matern 3/2 kernel. This kernel arise when setting v=3/2 in the matern family of kernels

Parameters:

Name Type Description Default
theta float

Amplitude

required
ell float

Characteristic lenght scale

required

Matern52(theta, ell)

Bases: covFunction

the Matern 5/2 kernel. This kernel arise when setting v=5/2 in the matern family of kernels

Parameters:

Name Type Description Default
theta float

Amplitude

required
ell float

Characteristic lenght scale

required

Linear(c)

Bases: covFunction

the Linear kernel

Parameters:

Name Type Description Default
c

Constant

required

GammaExp(theta, gamma, l)

Bases: covFunction

the gamma-exponential kernel

Parameters:

Name Type Description Default
theta

Amplitude

required
gamma

Shape parameter ( 0 < gamma <= 2)

required
l

Lenght scale

required

Polynomial(theta, a, b, c)

Bases: covFunction

the polynomial kernel

Parameters:

Name Type Description Default
theta

Amplitude ???

required
a

Real value > 0

required
b

Real value >= 0

required
c

Integer value

required
wn

White noise amplitude

required

Piecewise(eta)

Bases: covFunction

third-order piecewise polynomial kernel

Parameters:

Name Type Description Default
eta

float

required

Paciorek(amplitude, ell_1, ell_2)

Bases: covFunction

Definition of the modified Paciorek's kernel (stationary version).

Parameters:

Name Type Description Default
amplitude

float

required
ell_1

float

required
ell_2

float

required

NewPeriodic(amplitude, alpha2, P, l)

Bases: covFunction

Definition of a new periodic kernel derived from mapping the rational quadratic kernel to the 2D space u(x) = (cos x, sin x)

Parameters:

Name Type Description Default
amplitude

float

required
alpha2

float

required
P

float

required
l

float

required

QuasiNewPeriodic(amplitude, alpha2, ell_e, P, ell_p)

Bases: covFunction

Definition of a new quasi-periodic kernel. Derived from mapping the rational quadratic kernel to the 2D space u(x) = (cos x, sin x) and multiplying it by a squared exponential kernel

Parameters:

Name Type Description Default
amplitude

float

required
alpha2

float

required
ell_e

float

required
P

float

required
ell_p

float

required

NewRQP(amplitude, alpha1, alpha2, ell_e, P, ell_p)

Bases: covFunction

Definition of a new quasi-periodic kernel. Derived from mapping the rational quadratic kernel to the 2D space u(x) = (cos x, sin x) and multiplying it by a rational quadratic kernel

Parameters:

Name Type Description Default
amplitude

float

required
alpha1

float

required
ell_e

float

required
P

float

required
ell_p

float

required
alpha2

float

required

HarmonicPeriodic(N, amplitude, P, ell)

Bases: covFunction

Definition of a periodic kernel that models a periodic signal with a N number of harmonics. Obtained by mapping the squared exponetial with the Lagrange trigonometric identities

Parameters:

Name Type Description Default
N

int

required
amplitude

float

required
P

float

required
ell

float

required

QuasiHarmonicPeriodic(N, amplitude, ell_e, P, ell_p)

Bases: covFunction

Definition of a quasi-periodic kernel that models a periodic signals with a N number of harmonics. Comes from the multiplication of the squared exponential by the HarmonicPeriodic

Parameters:

Name Type Description Default
N

int

required
amplitude

float

required
ell_e

float

required
P

float

required
ell_p

float

required

CosPeriodic(amplitude, P, ell)

Bases: covFunction

Periodic kernel derived by mapping the squared exponential kernel into thw 2D space u(t) = [cos(t + phi), sin(t + phi)]

SPOILER ALERT: If you do the math the phi terms disappear

Parameters:

Name Type Description Default
amplitude

float

required
P

float

required
ell_p

float

required
phi

float

required

QuasiCosPeriodic(amplitude, ell_e, P, ell_p)

Bases: covFunction

This kernel is the product between the cosPeriodic kernel and the squared exponential kernel, it is just another the quasi-periodic kernel.

Parameters:

Name Type Description Default
amplitude

float

required
ell_e

float

required
ell_p

float

required
P

float

required