markovflow.kernels.constant

Module containing a kernel with a constant variance.

Module Contents

class Constant(variance: float, output_dim: int = 1, jitter: float = 0.0)[source]

Bases: markovflow.kernels.sde_kernel.StationaryKernel

Introduces a constant variance. This kernel has the formula:

\[C(x, x') = σ²\]

…where \(σ²\) is a kernel parameter representing the constant variance, which is supplied as a parameter to the constructor.

The transition matrix \(F\) in the SDE form for this kernel is \(F = [[1]]\).

Covariance for the steady state is \(P∞ = [[σ²]]\).

The state transition matrix is \(Aₖ = [[1]]\).

The process covariance is \(Qₖ = [[0]]\).

Parameters
  • variance – Initial variance for the kernel. Must be a positive float.

  • output_dim – The output dimension of the kernel.

  • jitter – A small non-negative number used to make sure that matrix inversion is numerically stable.

property state_dimint[source]

Return the state dimension of the generated StateSpaceModel.

state_transitions(transition_times: tf.Tensor, time_deltas: tf.Tensor)tf.Tensor[source]

Return the state transition matrices of the generated StateSpaceModel.

The state transition matrix at time step \(k\) is \(Aₖ = [[1]]\).

Because this is a stationary kernel, transition_times is ignored.

Parameters
  • transition_times – A tensor of times at which to produce matrices, with shape batch_shape + [num_transitions]. Note this is ignored.

  • time_deltas – A tensor of time gaps for which to produce matrices, with shape batch_shape + [num_transitions].

Returns

A tensor with shape batch_shape + [num_transitions, state_dim, state_dim].

process_covariances(transition_times: tf.Tensor, time_deltas: tf.Tensor)tf.Tensor[source]

Return the process covariance matrices of the generated StateSpaceModel.

The process covariance for time step k is \(Qₖ = [[0]]\).

Because this is a stationary kernel, transition_times is ignored.

Parameters
  • transition_times – A tensor of times at which to produce matrices, with shape `` batch_shape + [num_transitions]``. Note this is ignored.

  • time_deltas – A tensor of time gaps for which to produce matrices, with shape batch_shape + [num_transitions].

Returns

A tensor with shape batch_shape + [num_transitions, state_dim, state_dim].

transition_statistics(transition_times: tf.Tensor, time_deltas: tf.Tensor)Tuple[tf.Tensor, tf.Tensor][source]

Return the state_transitions and process_covariances.

Because this is a stationary kernel, transition_times is ignored.

Parameters
  • transition_times – A tensor of times at which to produce matrices, with shape batch_shape + [num_transitions]. Note this is ignored.

  • time_deltas – A tensor of time gaps for which to produce matrices, with shape batch_shape + [num_transitions].

Returns

A tuple of two tensors with respective shapes batch_shape + [num_transitions, state_dim, state_dim] batch_shape + [num_transitions, state_dim, state_dim].

property feedback_matrixtf.Tensor[source]

Return the feedback matrix \(F\). This is where:

\[dx(t)/dt = F x(t) + L w(t)\]
Returns

A tensor with shape [state_dim, state_dim].

property steady_state_covariancetf.Tensor[source]

Return the steady state covariance \(P∞\) of the generated StateSpaceModel. This is given by \(P∞ = [[σ²]]\).

Returns

A tensor with shape [state_dim, state_dim].

property variancegpflow.Parameter[source]

Return the variance parameter.