AnalyticalGaussianIntegrator#

class gpjax.integrators.AnalyticalGaussianIntegrator[source]#

Bases: AbstractIntegrator

Compute the analytical integral of a Gaussian likelihood.

When the likelihood function is Gaussian, the integral can be computed in closed form. For a Gaussian likelihood \(p(y|f) = \mathcal{N}(y|f, \sigma^2)\) and a variational distribution \(q(f) = \mathcal{N}(f|m, s)\), the expected log-likelihood is given by

\[ \mathbb{E}_{q(f)}[\log p(y|f)] = -\frac{1}{2}\left(\log(2\pi\sigma^2) + \frac{1}{\sigma^2}((y-m)^2 + s)\right) \]

integrate(fun, y, mean, variance, likelihood)[source]#

Compute a Gaussian integral.

Parameters:
  • fun (Callable) – The Gaussian likelihood to be integrated.

  • y (Float[Array, 'N D']) – The observed response variable.

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

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

  • likelihood (Gaussian) – The Gaussian likelihood function.

Returns:

The expected log likelihood.

Return type:

Float[Array, ‘N’]