LuasKernel.logL

LuasKernel.logL#

LuasKernel.logL(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). Also returns stored values from the matrix decomposition.

Note

Calculating the hessian of this function with jax.hessian may not produce numerically stable results. LuasKernel.logL_hessianable is recommended is values of the hessian are needed. This method typically outperforms LuasKernel.logL_hessianable in runtime for gradient calculations however.

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)