fit_phi_variance

sofia_redux.toolkit.resampling.fit_phi_variance(phi, inv_covariance)[source]

Calculates variance given the polynomial terms of a coordinate.

The output variance for given polynomial terms phi (\(\Phi\)) is given as:

\[V = \Phi^T Var(\hat{c}) \Phi\]

where \(Var(\hat{c})\) is the covariance matrix inverse of the fit coefficients (inv_covariance) such that \(Var(\hat{c})_{i, j}\) gives the covariance between the coefficients for terms \(i\) and \(j\), and the coefficients \(\hat{c}\) define the fit:

\[y = \hat{c} \cdot \Phi\]
Parameters:
phinumpy.ndarray (ncoeffs,)

The polynomial terms.

inv_covariancenumpy.ndarray (ncoeffs, ncoeffs)

The covariance matrix inverse of the fit coefficients.

Returns:
variancefloat

The calculated variance.