Many aspects of smoothing are comparable to regression; therefore, you can apply some of the techniques in Chapter 10, Evaluating Classifiers, Regressors, and Clusters, to smoothing too. In this recipe, we will smooth with the Savitzky-Golay filter, which conforms to the following equation:
The filter fits points within a rolling window of size n to a polynomial of order m. Abraham Savitzky and Marcel J. E. Golay created the algorithm around 1964 and first applied it to chemistry problems. The filter has two parameters that naturally form a grid. As in regression problems, we will take a look at a difference, in this case, the difference between the original signal and the smoothed signal. We assume, just like when we fit data, that the residuals are random and follow a Gaussian distribution.