Skip to main content

Module smoothing_spline

Module smoothing_spline 

Source
Expand description

The cubic smoothing spline (SciPy’s make_smoothing_spline): the function g minimising

Σ wᵢ (yᵢ − g(xᵢ))² + λ ∫ g''(x)² dx,

which is a natural cubic spline with knots at the data. Large λ approaches the straight-line least-squares fit, λ → 0 the interpolating natural spline. When λ is not given, it is chosen by generalised cross-validation (GCV).

See the book entry B-splines and smoothing splines.

Structs§

SmoothingSpline
The result of make_smoothing_spline: the spline and the smoothing parameter used.

Functions§

make_smoothing_spline
The cubic smoothing spline of (x, y) with weights w (default 1) and smoothing parameter lam (SciPy’s make_smoothing_spline). Without lam, the parameter minimising the GCV score n ‖y − ŷ‖² / (n − tr A(λ))² over 0 < λ < n is used, found by the same bounded Brent search as SciPy.