LuasKernel.logL_hessianable

LuasKernel.logL_hessianable#

LuasKernel.logL_hessianable(hp: Any, x_l: Array, x_t: Array, R: Array, stored_values: Any) Tuple[Any, Any][source]#

Computes the log likelihood using the method originally presented in Rakitsch et al. (2013) and also outlined in Fortune at al. (2024).

Note

The hessian of this log likelihood function can be calculated using jax.hessian and should be more numerically stable for this than LuasKernel.logL. However, this function is slower for calculating the gradients of the log likelihood so LuasKernel.logL is preferred unless the hessian is needed. Also returns stored values from the matrix decomposition.

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.

  • R (JAXArray) – Residuals to be fit calculated from the observed data by subtracting the deterministic mean function. Must have the same shape as the observed data (N_l, N_t).

  • 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.

Returns:

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

Return type:

(Scalar, PyTree)