markovflow.likelihoods.multivariate_gaussian
Module containing a multivariate Gaussian likelihood.
MultivariateGaussian
Bases: markovflow.likelihoods.likelihoods.Likelihood
markovflow.likelihoods.likelihoods.Likelihood
Represents a multivariate Gaussian likelihood. For example:
See also the documentation for the base Likelihood class.
Likelihood
chol_covariance – A TensorType containing the Cholesky factor of the covariance of the Gaussian noise, with shape [obs_dim, obs_dim].
TensorType
[obs_dim, obs_dim]
obs_dim
Return the dimensionality of each observation.
log_probability_density
Compute the log probability density \(log p(Y|F)\).
For a multivariate Gaussian, this is \(log 𝓝(yᵢ; fᵢ, Σ)\).
fs – A tensor representing a conditioning variable, with shape batch_shape + [num_data, obs_dim].
batch_shape + [num_data, obs_dim]
observations – A tensor representing a conditioned variable, with shape batch_shape + [num_data, obs_dim].
A tensor representing \(log p(yᵢ | fᵢ)\), with shape batch_shape + [num_data].
batch_shape + [num_data]
variational_expectations
Calculate a variational expectation for each observation:
…where:
\(q(fᵢ) ~ N(μᵢ, Σᵢ)\) \(p(y |f)\) is a general likelihood function
\(q(fᵢ) ~ N(μᵢ, Σᵢ)\)
\(p(y |f)\) is a general likelihood function
For a multivariate Gaussian this is:
f_means – The marginal \(f\) means for each state of the StateSpaceModel, with shape batch_shape + [num_data, obs_dim].
StateSpaceModel
f_covariances – The marginal \(f\) covariances for each state of the StateSpaceModel, with shape batch_shape + [num_data, obs_dim, obs_dim].
batch_shape + [num_data, obs_dim, obs_dim]
observations – The \(y\) values at which to evaluate the log probability, with shape batch_shape + [num_data, obs_dim].
A tensor with shape batch_shape + [num_data].
predict_density
Predict a density. This calculates:
…of a Gaussian approximation \(q(F) ~ N(μ, Σ)\) to the posterior density \(p(F|Y)\).
predict_mean_and_var
Predict the observation means and covariances given the f-space means and covariances.
That is, calculate:
f_means and f_covariances is our representation of \(p(f* | x*, x, y)\) \(p(y* | f*)\) is defined by the likelihood
f_means and f_covariances is our representation of \(p(f* | x*, x, y)\)
f_means
f_covariances
\(p(y* | f*)\) is defined by the likelihood
f_means – The marginal \(f\) means for some arbitrary predicted time points, with shape batch_shape + [num_data, obs_dim].
f_covariances – The marginal \(f\) covariances for some arbitrary predicted time points, with shape batch_shape + [num_data, obs_dim, obs_dim].
A tuple of tensors containing observation means and covariances, with respective shapes batch_shape + [num_time_points, obs_dim], batch_shape + [num_time_points, obs_dim, obs_dim].
batch_shape + [num_time_points, obs_dim]
batch_shape + [num_time_points, obs_dim, obs_dim]