Expand description
Efficiently compute the residual errors for all possible polynomial models up to some degree for given data.
§Example
For examples please have a look at the exported functions like residuals_from_front.
Modules§
- poly
- Basic polynomials in a Newton basis.
- weighted
- Provides versions of the main functions for the case of a weighted least squares fit. So we calculate the optimal target values of min_{p polynomial of deg d} ∑ᵢ wᵢ(p(xᵢ) - yᵢ)² for all d and valid discrete intervals of i.
Structs§
- PolyFit
- A fit polynomial together with its residual error
Enums§
- FitError
- The different errors that can occur during the polynomial fitting process.
Functions§
- all_
residuals - Compute the residual squared errors (RSS) for all polynomials of degree at most
max_degfor the data segmentsxs[j..=i],ys[j..=i]for alli,j. - all_
residuals_ par - A parallel version of all_residuals_par. Please have a look at the sequential version for details.
- residuals_
from_ front - Compute the residual squared errors (RSS) for all polynomials of degree at most
max_degfor the data segmentsxs[0..=i],ys[0..=i]for alli. - solve_
upper_ triangular_ system - Solves the linear system
matrix_product(lhs, x) = rhsforx. - try_
fit_ poly - Try fitting a polynomial to some data.
- try_
fit_ poly_ with_ residual - Try fitting a polynomial to some data and also compute the residual error.