markovflow.kernels.matern
Module containing the Matern family of kernels.
Matern12
Bases: markovflow.kernels.sde_kernel.StationaryKernel
markovflow.kernels.sde_kernel.StationaryKernel
Represents the Matern1/2 kernel. This kernel has the formula:
…where lengthscale \(ℓ\) and signal variance \(σ²\) are kernel parameters.
This defines an SDE where:
…so that \(Aₖ = exp(-Δtₖ/ℓ)\).
lengthscale – A value for the lengthscale parameter.
variance – A value for the variance parameter.
output_dim – The output dimension of the kernel.
jitter – A small non-negative number to add into a matrix’s diagonal to maintain numerical stability during inversion.
state_dim
Return the state dimension of the kernel, which is always one.
state_transitions
Return the state transition matrices kernel.
The state dimension is one, so the matrix exponential reduces to a standard one:
Because this is a stationary kernel, transition_times is ignored.
transition_times
transition_times – A tensor of times at which to produce matrices, with shape batch_shape + [num_transitions]. Ignored.
batch_shape + [num_transitions]
time_deltas – A tensor of time gaps for which to produce matrices, with shape batch_shape + [num_transitions].
A tensor with shape batch_shape + [num_transitions, state_dim, state_dim].
batch_shape + [num_transitions, state_dim, state_dim]
feedback_matrix
Return the feedback matrix \(F\). This is where:
For this kernel, note that \(F = - 1 / ℓ\).
A tensor with shape [state_dim, state_dim].
[state_dim, state_dim]
steady_state_covariance
Return the steady state covariance \(P∞\). For this kernel, this is the variance hyperparameter.
lengthscale
Return the lengthscale parameter. This is a GPflow Parameter.
variance
Return the variance parameter. This is a GPflow Parameter.
OrnsteinUhlenbeck
Represents the Ornstein–Uhlenbeck kernel. This is an alternative parameterization of the Matern1/2 kernel. This kernel has the formula:
…where decay \(λ\) and diffusion coefficient \(q\) are kernel parameters.
…so that \(Aₖ = exp(-λ Δtₖ)\).
decay – A value for the decay parameter.
diffusion – A value for the diffusion parameter.
For this kernel, note that \(F = -λ\).
Return the steady state covariance \(P∞\). For this kernel, this is q/2λ.
decay
Return the decay parameter. This is a GPflow Parameter.
diffusion
Return the diffusion parameter. This is a GPflow Parameter.
Matern32
Represents the Matern3/2 kernel. This kernel has the formula:
…where \(λ = √3 / ℓ\), and lengthscale \(ℓ\) and signal variance \(σ²\) are kernel parameters.
The transition matrix \(F\) in the SDE form for this kernel is:
Covariance for the initial state is:
…where variance is a kernel parameter.
Since the characteristic equation for the feedback matrix \(F\) for this kernel is \((λI + F)² = 0\), the state transition matrix is:
…where \(expm\) is the matrix exponential operator. Note that all higher order terms of \(expm((λI + F)Δtₖ)\) disappear.
_lambda
λ the scalar used elsewhere in the docstrings
Return the state dimension of the kernel, which is always two.
Return the state transition matrices for the kernel.
For this kernel, note that:
Return the steady state covariance \(P∞\). This is given by:
Matern52
Represents the Matern5/2 kernel. This kernel has the formula:
…where \(λ = √5 / ℓ\), and lengthscale \(ℓ\) and signal variance \(σ²\) are kernel parameters.
F = [ 0, 1, 0] [ 0, 0, 1] [-λ³, -3λ², -3λ]
P∞ = σ² [ 1, 0, -λ²/3] [ 0, λ²/3, 0] [-λ²/3, 0, λ⁴]
Since the characteristic equation for the feedback matrix \(F\) for this kernel is \((λI + F)³ = 0\), the state transition matrix is:
…where \(expm\) is the matrix exponential operator. Note that all higher order terms disappear.
Return the state dimension of the kernel, which is always three.
F = [[ 0, 1, 0] [ 0, 0, 1] [-λ³, -3λ², -3λ]]
_check_lengthscale_and_variance
Verify that the lengthscale and variance are positive