Another method of smoothing time series data is using moving medians rather than means. This can help identify trends in the data by reducing or removing large fluctuations.
Instead of finding the mean of a group of values, moving medians finds the median of a group of values. Recall that to find the median, the data must be ordered, and the middle number determined.
To calculate x, notice that the centre is in alignment with the three data points indicated in blue. These three data points are used to calculate the median.
Looking at the data values for time periods 3,4, and 5, we can write them in ascending order to give 86,105,131. The median of these is 105.
So the three-point median value for time period 4 is 105. Therefore, x=105.
Similarly, to calculate y indicated in green use the using five-point moving median.
Arranging in ascending order we have 105,115,115,130,141. So the new value given for time period 9 using five-point moving median is 115.
The graph below illustrates the smoothing effect of these moving medians.
As with the moving means, the three-point moving median is better able to smooth the data compared with the five-point moving median, again because there are 3 seasons or points per cycle.
Note also that data points are lost when using moving medians, as with the process of moving means.
(Moving medians can be done with an even number of points too, but is not necessary in this course.)
Consider the following table:
Calculate and fill in the missing values of the table.
\text{Time Period} | \text{Data} | \text{3 Point Median} |
---|---|---|
1 | 54 | \text{N/A} |
2 | 45 | ⬚ |
3 | 50 | 47 |
4 | ⬚ | 47 |
5 | 42 | 47 |
6 | 48 | 48 |
7 | 49 | 48 |
8 | 43 | ⬚ |
9 | 48 | 47 |
10 | 47 | 47 |
11 | 39 | 46 |
12 | 46 | \text{N/A} |
We can a smooth time series data by calculating the moving medians of each 3 or 5 data points in a table.
The method of moving medians is often easier to do directly onto a time series plot as in the following question.
Consider the following Time Series Data.
Plot the 5 point moving median to the graph.
We can smooth graphically by setting the median of a group of 3 or 5 x-coordinates and y-coordinates as the coordinates of 3 or 5 moving medians.