Linearization

class pmrf.stats.linearization.Linearization(J: Array, residual: Array, chol: Array, F: Array, names: tuple[str, ...], shapes: tuple[tuple[int, ...], ...], space: Space)

Bases: Module

The linearisation of one fit at a model.

Built by pmrf.objectives.evaluators.MarginalLogLikelihood.linearize(). Columns of J, and rows and columns of F, follow the free parameters in names order, each flattened in C order to its size in shapes.

unflatten(vector: Array) → dict[str, Array]

Map a flat vector over the parameters, such as a row of F, back to names.

F: Array

The Fisher matrix \(F = \sum_b J_b^\top \Sigma_{D,b}^{-1} J_b\), with shape (p, p).

J: Array

The Jacobian \(J = -\partial r / \partial \theta\) of the residual, with shape (*batch, N, p).

chol: Array

The lower Cholesky factor of \(\Sigma_D = K + \Sigma_n\), at its own batch shape, which broadcasts to batch.

names: tuple[str, ...]

The names of the free parameters, in column order.

residual: Array

The residual \(r\) in event space, with shape (*batch, N).

shapes: tuple[tuple[int, ...], ...]

The shape of each free parameter’s value, in names order.

space: Literal['raw', 'declared', 'physical']

The space the parameter values, and so J and F, are in.