marglog

paleokalmag.marglog(pars, data, lmax=8, R=2800, grad=False, mean=None, cov=None, data_has_base=False, model_class=<class 'paleokalmag.corefieldmodel.CoreFieldModel'>)[source]

Calculates the log forward marginal likelihood.

Parameters:
  • pars (array or tensor) – The set of parameters for which the marginal likelihood will be evaluated.

  • data (ChunkedData) – The data.

  • lmax (int, optional) – The maximal spherical harmonics degree. Default is 8.

  • R (float, optional) – The reference radius for the model in km. Default is 2800.

  • grad (bool, optional) – Whether to return the gradient. Works only if an array is passed. If a tensor is passed, calculate the gradient manually.

  • data_has_base (bool, optional) – Whether the data chunks contain an attribute .base with the basis functions precomputed. Precomputing the basis can immensely speed up calculations.

  • model_class (class, optional) – With careful design of __init__ attributes, this function can be used for field models with a different prior. Pass your own model class to this kwarg.

Returns:

The log forward marginal likelihood as a tensor.

Return type:

tensor