SmoothSpline: fit smoothing spline to noisy data
by
Brenden Epps
Fit a cubic or quintic smoothing spline to noisy data, with minimum-possible error while still having minimal roughness.
Updated
30 Jul 2021
SmoothSpline is a program for obtaining the best-fit smoothing spline to a set of noisy y(x) data. This spline is "best" in the sense that it has the minimum possible error, while still having minimal roughness.
SmoothSpline calls spaps from the Matlab Curve Fitting Toolbox. While spaps(x,y,tol) returns the spline with minimal roughness for a given error tolerance, tol, the user is left to determine the appropriate tol for the best fit. SmoothSpline allows the user to either manually or automatically determine the best-fit tol.
SmoothSpline is intended for use with high-resolution, high-precision data. In this case, Epps et al. (2010) observed that there exists a critical error tolerance, above which the roughness is relatively constant (due to the "roughness" of the true underlying function) and below which the roughness increases dramatically as the spline is forced to pass closer to the noisy data.
SmoothSpline is particularly useful for determining the derivatives (dy/dx, d^2y/dx^2, …) of noisy data, which cannot be obtained accurately via finite differences.
Cite As
B.P. Epps, T.T. Truscott, and A.H. Techet, "Evaluating derivatives of experimental data using smoothing splines," Mathematical Methods in Engineering International Symposium, Coimbra, Portugal, October 2010.
MATLAB Release Compatibility
Created with
R2019a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
