LuasKernel.eigendecomp_use_stored_values

LuasKernel.eigendecomp_use_stored_values#

LuasKernel.eigendecomp_use_stored_values(hp: Any, x_l: Array, x_t: Array, stored_values: Any | None = {}, rtol: Any | None = 1e-12, atol: Any | None = 1e-12) Any[source]#

Required calculations for the decomposition of the overall matrix K where the previously stored decomposition of K may be used for the calculation of a new decomposition. This checking if any of the matrices have changed and if they are similar within the given tolerances a previously computed eigendecomposition can be used to avoid recalculating it. This can provide significant runtime savings if some hyperparameters are being kept fixed including if blocked Gibbs sampling is being used on groups of hyperparameters.

We can decompose the inverse of K into the matrices:

\[K^{-1} = [W_l \otimes W_t] D^{-1} [W_l^T \otimes W_t^T]\]

Where this function will calculate W_l, W_t and D_inv and stored them in the stored_values PyTree for future log likelihood calculations.

Parameters:
  • hp (Pytree) – Hyperparameters needed to build the covariance matrices Kl, Kt, Sl, St. Will be unaffected if additional mean function parameters are also included.

  • x_l (JAXArray) – Array containing wavelength/vertical dimension regression variable(s) for the observed locations. May be of shape (N_l,) or (d_l,N_l) for d_l different wavelength/vertical regression variables.

  • x_t (JAXArray) – Array containing time/horizontal dimension regression variable(s) for the observed locations. May be of shape (N_t,) or (d_t,N_t) for d_t different time/horizontal regression variables.

  • stored_values (PyTree) – Stored values from the decomposition of the covariance matrices. For LuasKernel this consists of values computed using the eigendecomposition of each matrix and also the log determinant of K.

  • rtol (Scalar) – The relative tolerance value any of the component covariance matrices must be within in order for the matrix to be considered unchanged and stored values for its decomposition to be used.

  • atol (Scalar) – The absolute tolerance values any of the component covariance matrices must be within in order for the matrix to be considered unchanged and stored values for its decomposition to be used.

Returns:

Stored values from the decomposition of the covariance matrices. For LuasKernel this consists of values computed using the eigendecomposition of each matrix and also the log determinant of K.

Return type:

PyTree