Skip to main content

bisplrep

Function bisplrep 

Source
pub fn bisplrep(
    x: &[f64],
    y: &[f64],
    z: &[f64],
    w: Option<&[f64]>,
    kx: usize,
    ky: usize,
    smoothing: Option<f64>,
) -> Result<SmoothBivariateSpline, ErrorsJSL>
Expand description

A smoothing spline surface through scattered data with automatically placed knots (SciPy’s bisplrep / SmoothBivariateSpline, after FITPACK’s surfit): of the splines with Σ (wᵢ (zᵢ − s(xᵢ, yᵢ)))² ≤ smoothing, the one whose kx-th x- and ky-th y-derivatives jump least across the knots. smoothing = None gives SciPy’s default m − √(2m).

Starting from a single polynomial patch, one knot at a time is added in the direction (x or y) whose largest interval residual sum is the larger, at the residual-weighted mean coordinate of the points in that interval (FITPACK’s rule, which SciPy follows to the digit), until the least-squares surface reaches the smoothing target or nxest, nyest knots (SciPy’s defaults); then the penalty weight p is found by FITPACK’s rational iteration so that the residual sum equals the target.