AbstractLikelihood#
- class gpjax.likelihoods.AbstractLikelihood(integrator=<gpjax.integrators.GHQuadratureIntegrator object>)[source]#
Bases:
_SummaryMixin,ModuleAbstract base class for likelihoods.
All likelihoods must inherit from this class and implement the
predictandlink_functionmethods.- Parameters:
integrator (AbstractIntegrator)
- 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:
- abstractmethod link_function(f)[source]#
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