ExactPosterior#
- class gpjax.conditioning.ExactPosterior(prior, likelihood, train_data)[source]#
Bases:
PosteriorExactly conditioned GP: a Gaussian likelihood integrated analytically.
Caches the lower Cholesky factor of \(\Sigma = K_{xx} + \texttt{jitter}\,\mathbf{I} + \mathrm{diag}(\sigma^2)\) and the representer weights \(\alpha = \Sigma^{-1}(y - m(x))\). The predictive moments, the evidence, LOO densities, and pathwise samples are all views of these two objects.
- loo()[source]#
Per-point leave-one-out predictive log-densities.
Computed from the cached factor via Rasmussen & Williams eq. 5.12 — no model is refit. Sum the result for the LOOCV objective.
- Return type:
Float[jaxlib._jax.Array, ‘NP’] | Float[ndarray, ‘NP’]
- sample_approx(num_samples, key, num_features=100)[source]#
Draw approximate posterior samples via pathwise conditioning.
Decomposes each sample into Fourier features of the prior plus canonical features weighted through the cached training factor (Wilson et al., 2020).
- Parameters:
- Returns:
- A function evaluating the sample draws at any
inputs; the same draw is returned for all queries.
- Return type: