pint.utils.normalize_designmatrix

pint.utils.normalize_designmatrix(M, params)[source]

Normalize each row of the design matrix.

This is used while computing the GLS chi2 and the GLS fitting step. The normalized and unnormalized design matrices Mn and M are related by

M = Mn @ S

where S is a diagonal matrix containing the norms. This normalization is OK because the GLS operations (fitting step, chi2 computation etc.) involve the form

M @ (M.T @ N.inv() @ M).inv() @ M.T

and it is easy to see that the above expression doesn’t change if we replace M -> Mn.

Different parameters can have different units and numerically vastly different design matrix entries. The normalization step forces the design matrix entries to have similar numericall values and hence improves the numerical precision of the matrix operations.