Get the linear fitting data.
(mu, u)
| 749 | |
| 750 | |
| 751 | def _compose_linear_fitting_data(mu, u): |
| 752 | """Get the linear fitting data.""" |
| 753 | k1 = np.arange(1, u["nterms"]) |
| 754 | mu1ns = mu[0] ** k1 |
| 755 | # data to be fitted |
| 756 | y = u["w"][:-1] * (u["fn"][1:] - mu1ns * u["fn"][0]) |
| 757 | # model matrix |
| 758 | M = u["w"][:-1, np.newaxis] * (mu[1:] ** k1[:, np.newaxis] - mu1ns[:, np.newaxis]) |
| 759 | uu, sing, vv = _safe_svd(M, full_matrices=False) |
| 760 | ncomp = u["nfit"] - 1 |
| 761 | uu, sing, vv = uu[:, :ncomp], sing[:ncomp], vv[:ncomp] |
| 762 | return y, uu, sing, vv |
| 763 | |
| 764 | |
| 765 | def _compute_linear_parameters(mu, u): |
no test coverage detected