If a time series contains random variations, then fitting a linear trend is not very accurate. To ‘level out’ the data we use a technique called smoothing.
Each data value is replaced with the mean of that value and its two neighbours, one on each side. The first and last points do not have values on both sides so they are dismissed from the data set.
Using the data in Table 1, where y* represents the 3-point medians, a graph (Graph 1) is produced to demonstrate how the data values appear when they are smoothed out.
This method is the same as the three-point moving mean but finds the mean across five points. That is, the value itself and two neighbours from each side. The first and last two values are omitted as they do not have two values on each side of them.
When there are an even number of points, a process called centring must be used. This involves taking a 2-moving mean of the already smooth values so that they line up with the original time values. Therefore, as well as finding the smoothed values, a 2-point moving mean must also be done.
Four-point moving mean. 1
The advantage of median smoothing over mean smoothing is it is primarily a graphical technique and that it is not influenced by a single outlier.
Each data point is replaced with the median of that value and the values of its two neighbours, one on each side. Again, the first and last points do not have both neighbours and are therefore disregarded.
In this case, the median of five points are used. The first and last two points do not have two values on each side and are therefore omitted from the smoothing.
y* represents a 3-moving median and y** represents a 5-moving median.
Using these smoothing methods, the following graph (Graph 2) is produced. From observation alone, it is clear that the data has been smoothed out.
See also:
Four-point moving mean, Essential Further Mathematics 4th Edition Enhanced, pg 215 ↩
Want to suggest an edit? Have some questions? General comments? Let us know how we can make this resource more useful to you.