FUNCTION REFERENCE
spaps
Smoothing spline within a tolerance.
Smoothing spline within a tolerance.
Syntax
sp = spaps(x, y, tol)Syntax
[sp, values, rho] = spaps(x, y, tol, w)Syntax
[sp, values, rho] = spaps(x, y, tol, w, m)The cubic smoothing spline that minimises rho*E(f) + integral(f''(t)^2) with E(f) = sum(w.*(y - f(x)).^2) and rho chosen so that E(f) = tol (Reinsch's method). w defaults to the composite trapezoid weights of x. A tol below zero gives rho = -tol directly; tol = 0 the natural interpolant (rho = Inf); when the weighted least-squares line is already within tol it is returned with rho = 0. sp is a B-form (order 4, knots augknt(x, 4)); values = fnval(sp, x) in the shape of y; y may have one row per component.
Example
[sp, v, rho] = spaps(0:5, [0 1.2 1.8 3.4 3.9 5.2], 0.2); rho > 0Differences from MATLAB: only m = 2 is supported; a tolerance per site range and gridded data are not supported yet.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.