Skip to main content

generate_knots

Function generate_knots 

Source
pub fn generate_knots(
    x: &[f64],
    y: &[f64],
    options: &SplrepOptions<'_>,
) -> Result<Vec<Vec<f64>>, ErrorsJSL>
Expand description

The successive knot vectors FITPACK tries (SciPy’s generate_knots): from the 2(k + 1) knots of a polynomial, knots are added where the least-squares spline fits worst — 1, 2, 4, … per round, fewer as the residual nears s — until the least-squares residual is at most s, the limit nest is reached, or the knots become those of the interpolating spline. The last vector is the one make_splrep uses.