markovflow.models.gaussian_process_regression
Module containing a model for GP regression.
GaussianProcessRegression
Bases: markovflow.models.models.MarkovFlowModel
markovflow.models.models.MarkovFlowModel
Performs GP regression.
The key reference is Chapter 2 of:
Gaussian Processes for Machine Learning Carl Edward Rasmussen and Christopher K. I. Williams The MIT Press, 2006. ISBN 0-262-18253-X.
This class uses the kernel and the time points to create a state space model. GP regression is then a Kalman filter on that state space model using the observations.
kernel – A kernel defining a prior over functions.
input_data – A tuple of (time_points, observations) containing the observed data: time points of observations, with shape batch_shape + [num_data], observations with shape batch_shape + [num_data, observation_dim].
(time_points, observations)
batch_shape + [num_data]
batch_shape + [num_data, observation_dim]
chol_obs_covariance – A TensorType containing the Cholesky factor of the observation noise covariance, with shape [observation_dim, observation_dim]. a default None value will assume independent likelihood variance of 1.0
TensorType
[observation_dim, observation_dim]
mean_function – The mean function for the GP. Defaults to no mean function.
time_points
Return the time points of observations.
A tensor with shape batch_shape + [num_data].
observations
Return the observations.
A tensor with shape batch_shape + [num_data, observation_dim].
kernel
Return the kernel of the GP.
mean_function
Return the mean function of the GP.
loss
Return the loss, which is the negative log likelihood.
posterior
Obtain a posterior process for inference.
For this class, this is the AnalyticPosteriorProcess built from the Kalman filter.
AnalyticPosteriorProcess
log_likelihood
Calculate the log likelihood of the observations given the kernel parameters.
In other words, \(log p(y_{1...T} | ϑ)\) for some parameters \(ϑ\).
A scalar tensor (summed over the batch shape and the whole trajectory).