solve_amat_beta

sofia_redux.toolkit.resampling.solve_amat_beta(phi, data, weights)[source]

Convenience function returning matrices suitable for linear algebra.

Given independent variables \(\Phi\), data \(y\), and weights \(W\), returns matrices \(A\) and \(B\) where:

\[ \begin{align}\begin{aligned}A = \Phi W \Phi^T\\B = \Phi W y\end{aligned}\end{align} \]
Parameters:
phinumpy.ndarray (n_terms, n_samples)

Polynomial terms of independent variables for each sample in the fit.

datanumpy.ndarray (n_samples,)

Sample data values.

weightsnumpy.ndarray (n_samples,)

Squared weights.

Returns:
A, Bnumpy.ndarray (n_terms, n_terms), numpy.ndarray (n_terms,)

The \(A\) and \(B\) terms described above.