GP.logP_stored

Contents

GP.logP_stored#

GP.logP_stored(p: Any, Y: Array, stored_values: Any) Tuple[Any, Any][source]#

Computes the log posterior and also returns any stored values from the decomposition of the covariance matrix. This allows time to be saved in future log likelihood calculations in which some hyperparameters are either fixed or being sampled separately with Gibbs/Blocked Gibbs sampling.

Note

This function will not give correct second order derivatives/hessian values (e.g. calculated using jax.hessian). Make sure to use GP.logP_hessianable_stored if any hessian calculations are required.

Parameters:
  • p (PyTree) – Pytree of hyperparameters used to calculate the covariance matrix in addition to any mean function parameters which may be needed to calculate the mean function. Also input to the logPrior function for the calculation of the log priors.

  • Y (JAXArray) – Observed data to fit, must be of shape (N_l, N_t).

  • stored_values (PyTree) – Stored values from the decomposition of the covariance matrix. The specific values contained in this PyTree depend on the choice of Kernel object and are returned by Kernel.decomp_fn.

Returns:

A tuple where the first element is the value of the log posterior. The second element is a PyTree which contains stored values from the decomposition of the covariance matrix.

Return type:

(Scalar, PyTree)