Class lsst::meas::modelfit::Likelihood

class Likelihood

Base class for optimizer/sampler likelihood functions that compute likelihood at a point.

Likelihood abstracts the problem of computing the likelihood over different kinds of data. It is responsible for creating a “model matrix” that maps amplitudes to data values, and maintaining a vector of scaled, weighted data values that corresponds to it. Its components can be represented best in the mathematical formula for a -log likelihood assuming Gaussian data and a model with both nonlinear parameters \(\theta\) and linear (“amplitude”) parameters \(\alpha\):

\[ L(\alpha,\theta) = \frac{1}{2}\left(y - A(\theta)\alpha\right)^T\, \Sigma^{-1}\,\left(y - A(\theta)\alpha\right) \]
where \(y\) is the data vector, \(\Sigma\) is the data covariance matrix (assumed to be diagonal), and \(A(\theta)\) is the “true” model matrix (parametrized on the nonlinear parameters).

When fitting or sampling from the likelihood, however, we don’t want to use these quantities directly, and they aren’t what the Likelihood class provides. Instead, we reparametrize with:

\[ w_i \equiv \Sigma_{i,i}^{-1/2} \]
\[ z_i = w_i y_i \]
\[ B_{i,j} = w_i A_{i,j} \]
resulting in the equivalent formula:
\[ L(\alpha,\theta) = \frac{1}{2}\left(z-B(\theta)\alpha\right)^T\,\left(z-B(\theta)\alpha\right) \]
The \(w_i\) are the weights, which are applied to both the data vector and the model matrix to account for the noise in the data. In some cases, we may choose to use a constant weight rather than per-pixel weights, but will will still use a vector to represent it.

Subclassed by lsst::meas::modelfit::MultiShapeletPsfLikelihood, lsst::meas::modelfit::UnitTransformedLikelihood