posterior_covariance

pmrf.stats.linearization.posterior_covariance(linearizations: Sequence[Linearization], model: PyTree, space: Literal['raw', 'declared', 'physical'] = 'declared') → Array

The linearised posterior covariance of a model’s free parameters.

Mathematical Formulation

The Fisher matrices of independent fits add, and the prior enters through its precision at model:

\[\Sigma_\text{post} = \left(\sum_k F_k + \Sigma_0^{-1}\right)^{-1}, \qquad \Sigma_0^{-1} = -\nabla^2 \log p(\theta)\]

with the Hessian of pmrf.log_prior() taken in space. A parameter without a prior, or with a uniform prior inside its bounds, adds zero to \(\Sigma_0^{-1}\).

Parameters:
  • linearizations (Sequence[Linearization]) – One linearisation per independent fit, each of model in space.

  • model (PyTree) – The model the linearisations were taken at, carrying the prior. Must still be wrapped.

  • space ({'declared', 'physical', 'raw'}, default='declared') – The space of the parameter values. See pmrf.Param.

Returns:

The covariance, with shape (p, p), over the free parameters in the linearisations’ names order.

Return type:

jax.Array

Raises:

ValueError – If no linearisation is given, or one is over other parameters or another space.