HeteroscedasticGaussian#
- class gpjax.likelihoods.HeteroscedasticGaussian(num_datapoints: 'int', noise_prior: 'Prior', noise_transform: 'tp.Union[AbstractNoiseTransform, tp.Callable[[Float[Array, ...]], Float[Array, ...]]]' = SoftplusTransform(), integrator: 'AbstractIntegrator' = <gpjax.integrators.GHQuadratureIntegrator object at 0x7f302bacfb90>)[source]#
Bases:
AbstractHeteroscedasticLikelihoodExpand for references to
gpjax.likelihoods.HeteroscedasticGaussian- Parameters:
num_datapoints (int)
noise_prior (Any)
noise_transform (AbstractNoiseTransform)
integrator (AbstractIntegrator)
- expected_log_likelihood(y, mean, variance, mean_g=None, variance_g=None, noise_stats=None, return_parts=False, **_)[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.
**_ (Any) – Unused extra arguments for compatibility with specialised likelihoods.
noise_stats (NoiseMoments | None)
return_parts (bool)
**_
- Returns:
The expected log likelihood.
- Return type:
- link_function(f, g=None)[source]#
The conditional observation density \(p(y \mid f, g)\).
For a heteroscedastic likelihood the observation noise is itself a function of a second latent process \(g\), so the conditional is \(\mathcal{N}(y \mid f, \sigma^2(g))\) (Lázaro-Gredilla & Titsias, 2011). Unlike the homoscedastic likelihoods, \(f\) alone does not determine the density, so
gis required.- Parameters:
f (Float[Array, "..."]) – the latent signal process values.
g (Float[Array, "..."] | None) – the latent noise process values. Required — there is no conditional density without it.
- Returns:
The observation density given both latent processes.
- Return type:
npd.Normal
- Raises:
ValueError – If
gis not supplied.
- predict(dist, noise_dist=None)[source]#
Evaluate the likelihood function at a given predictive distribution.
- Parameters:
dist (MultivariateNormal | GaussianDistribution) – The predictive distribution to evaluate the likelihood at.
noise_dist (MultivariateNormal | GaussianDistribution | None)
- Returns:
The predictive distribution.
- Return type:
npd.Distribution