AbstractLikelihood#

class gpjax.likelihoods.AbstractLikelihood(num_datapoints, integrator=<gpjax.integrators.GHQuadratureIntegrator object>)[source]#

Bases: _SummaryMixin, Module

Abstract base class for likelihoods.

All likelihoods must inherit from this class and implement the predict and link_function methods.

Parameters:
expected_log_likelihood(y, mean, variance, mean_g=None, variance_g=None, **_)[source]#

Compute the expected log likelihood.

For a variational distribution \(q(f)\sim\mathcal{N}(m, s)\) and a likelihood \(p(y|f)\), compute the expected log likelihood:

\[\mathbb{E}_{q(f)}\left[\log p(y|f)\right]\]
Parameters:
  • y (Float[Array, 'N D']) – The observed response variable.

  • mean (Float[Array, 'N D']) – The variational mean.

  • variance (Float[Array, 'N D']) – The variational variance.

  • mean_g (Float[Array, 'N D']) – Optional moments of the latent noise process for heteroscedastic likelihoods.

  • variance_g (Float[Array, 'N D']) – Optional moments of the latent noise process for heteroscedastic likelihoods.

  • **_ – Unused extra arguments for compatibility with specialised likelihoods.

Returns:

The expected log likelihood.

Return type:

ScalarFloat

Return the link function of the likelihood function.

Parameters:

f (Float[Array, "..."]) – the latent Gaussian process values.

Returns:

The distribution of observations, y, given values of the

Gaussian process, f.

Return type:

npd.Distribution

abstractmethod predict(dist)[source]#

Evaluate the likelihood function at a given predictive distribution.

Parameters:

dist (MultivariateNormal | GaussianDistribution) – The predictive distribution to evaluate the likelihood at.

Returns:

The predictive distribution.

Return type:

npd.Distribution