Expand description
Polynomial least-squares fitting via the normal equations (VᵀV) c = Vᵀy, solved by
Gaussian elimination with partial pivoting (the small (d+1)×(d+1) system).
Functions§
- poly_
eval - Evaluate a polynomial given ascending coefficients at
x(Horner). - poly_
fit - Fit a degree-
degreepolynomial to(xs, ys)in the least-squares sense. Returns coefficients in ascending order[c₀, c₁, …, c_degree](so the polynomial isΣ cₖ xᵏ). Fails closed if there are too few points or the system is singular.