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 Φ, data y, and weights W, returns matrices A and B where:

A=ΦWΦTB=ΦWy
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.