interpolate::smooth
Smoothing noisy samples: penalized cubic splines, Savitzky-Golay filters and LOWESS.
Modules
lowessLOWESS, locally weighted scatterplot smoothing (Cleveland 1979): at each x, the weighted least-squares line through the nearest frac * n points with tricube weights; thenitersrobustness passes that reweight by the bisquare of the residuals over six median absolute residuals.savgolSavitzky-Golay filters (1964): each output is the value (or a derivative) at the window's centre of the least-squares polynomial through the window, which is a fixed correlation with weights from the pseudo-inverse of the window's Vandermonde matrix.splineThe cubic smoothing spline: the g minimizing sum w_i (y_i - g(x_i))^2 + lam * integral g''^2, by Reinsch's algorithm (1967): with Q the second-difference and R the tridiagonal Gram matrices of the natural cubic spline, the second derivatives solve the pentadiagonal SPD system (R + lam Q^T W^-1 Q) gamma = Q^T y, and g = y - lam W^-1 Q gamma.