Expand description
B-splines of any degree, following scipy.interpolate: the BSpline type (evaluation,
derivatives, antiderivatives and integrals), interpolating splines with a choice of end
conditions (make_interp_spline), least-squares splines on given knots
(make_lsq_spline) and parametric interpolating curves (make_interp_curve).
A spline of degree k with knots t₀ ≤ t₁ ≤ … ≤ t_{n+k} is a sum s(x) = Σ cⱼ Bⱼ,ₖ(x) of the
B-spline basis functions, each a piecewise polynomial of degree k that is non-zero only on
[tⱼ, tⱼ₊ₖ₊₁). They are evaluated by the Cox-de Boor recurrence, and an interpolating spline
is found by solving a banded linear system for the coefficients.
See the book entry B-splines and smoothing splines.
Structs§
- BSpline
- A spline
s(x) = Σ cⱼ Bⱼ,ₖ(x)of degreekin the B-spline basis (SciPy’sBSpline).
Enums§
- Boundary
Condition - End conditions for
make_interp_spline(SciPy’sbc_type). - Extrapolate
- What a
BSplinereturns outside its base interval[t_k, t_n].
Functions§
- make_
interp_ curve - An interpolating parametric curve through the rows of
points(ann × darray): the parameter is the cumulative chord length normalised to[0, 1](assplprepchooses it), and each coordinate is interpolated withmake_interp_spline. Returns the parameter values and one spline per coordinate. - make_
interp_ spline - The interpolating spline of degree
kthrough(x, y)(SciPy’smake_interp_spline). - make_
lsq_ spline - The least-squares spline of degree
kon the knotst: minimisesΣ (wᵢ (yᵢ − s(xᵢ)))²(SciPy’smake_lsq_spline; note that the weights multiply the residuals, not their squares). The data must satisfy the Schoenberg-Whitney conditions (each basis function must be non-zero at some data point) for the solution to be unique. - nonzero_
basis - The
k + 1B-splines of degreekthat are non-zero on the knot intervalt[l] ≤ x < t[l + 1], namelyB_{l−k}, …, B_l, by the Cox-de Boor recurrence (de Boor’sbsplvb). Each degree is built from the previous one; the values are non-negative and sum to one. - nonzero_
basis_ derivatives - The
nu-th derivatives of thek + 1B-splines that are non-zero on intervall, from the basis of degreek − nuand the derivative formulaB'ⱼ,ₖ = k (Bⱼ,ₖ₋₁ / (tⱼ₊ₖ − tⱼ) − Bⱼ₊₁,ₖ₋₁ / (tⱼ₊ₖ₊₁ − tⱼ₊₁)).