Functions > Data Analysis > Smoothing > Adaptive Smoothing
  
Adaptive Smoothing
The supsmooth function performs super smoothing, a fast algorithm that uses an adjustable window to calculate a localized linear fit to the data.
supsmooth(vx, vy)—Returns a vector created by the piecewise use of a symmetric nearest neighbor linear least-squares fitting on each element in vy, in which the number of nearest neighbors is adaptively chosen.
The supsmooth function is most useful when your data lies along a band of relatively constant width.
The supsmooth algorithm utilizes a local smoother that performs a localized linear fit. As is the case for median smoothing, the algorithm moves through the data, focusing on a window of values. The x and y values within the window are used to determine a local linear least-squares fit.
The window length is calculated for each x value using cross-validation estimation. The localized window-adjustment makes supsmooth particularly useful in cases where data display different degrees of noise in different portions of the measurement.
Some types of data are better smoothed with one type of algorithm over another. You may wish to compare this method with median smoothing or Gaussian Kernel smoothing. The loess polynomial regression technique is also an effective smoother.
Arguments
vx is a vector of real numbers with elements in strictly ascending order. No two values can be the same.
vy is a vector of real numbers the same length as vx.