Crate polyfit_residuals

Crate polyfit_residuals 

Source
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_deg for the data segments xs[j..=i], ys[j..=i] for all i, 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_deg for the data segments xs[0..=i], ys[0..=i] for all i.
solve_upper_triangular_system
Solves the linear system matrix_product(lhs, x) = rhs for x.
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.