Although it is not necessary to first deseasonalise time series data before fitting a least squares regression line, it is often performed in this order. The least squares line can then be used to make predictions being mindful of the issue of extrapolation.
Examine the smoothing effect that deseasonalising the data has on the original data set:
The deseasonalised data looks much smoother than the original data which will aid in fitting a least squares regression line.
In order to substitute values into a regression line, it is first necessary to give each time period a numerical value, as shown in the table below, where for example, March 2012 is represented by the number 1.
Using a CAS calculator, it is now possible to enter the time values as the independent variable and the deseasonalised data as the dependent variable, and fit to this a linear regression model.
The equation of the least squares line is now y=494.4746-3.2519t.
This line can now be used to predict a future value.
For example, consider the value for September 2015.
The time period associated with September 2015 will be t=15. This is obtained by counting on from the last piece of available data in the table.
Substituting t=15 into the regression line to make a prediction obtains y=445.6968.
It is important to remember however, that this is the deseasonalised value for September 2015, or the smoothed value. In the graph above, this would be the value taken from the green plotted data.
To find the more realistic value which contains the seasonality component, it is necessary to simply reverse the deseasonalising process by multiplying the predicted value by the appropriate seasonal index.
Recall the seasonal indices from before:
So to finalise the prediction for September 2015 we multiply by the seasonal index for September:
\begin{aligned} y&=445.6968\times 1.0135\\ y&=445.7137 \end{aligned}
Steps to predict from time series data:
Smooth the data by deseasonalising.
Give each time period a number.
Calculate the equation of the least-squares regression line.
Substitute a future time value into the equation of the least-squares regression line to predict score.
Multiply the predicted score by the appropriate seasonal index to factor back in the seasonality of the data.
When using time series data the prediction will almost always be an extrapolation. As such, the predictions might be somewhat unreliable due to the inability to accurately predict future events. However, in general so long as the prediction has been made within one cycle of the available data, it is considered reliable.
In the example above, one cycle was four quarters, and the last available piece of data was December 2014. So any prediction made for any of the quarters in 2015 would be considered reliable as they are within one cycle of December 2014. When predicting for 2016 and beyond, there is a much higher risk of being inaccurate.
The following data shows the sales of air conditioners at a leading retailer over four quarters from 2012 to 2014.
Time period | Number of air conditioners sold | Proportion of yearly mean | Deseasonalised data |
---|---|---|---|
\text{1 (March 2012)} | 1042 | 0.8529 | ⬚ |
\text{2 (June 2012)} | 486 | 0.3978 | ⬚ |
\text{3 (Sept 2012)} | 613 | 0.5017 | ⬚ |
\text{4 (Dec 2012)} | 2746 | 2.2476 | ⬚ |
\text{5 (March 2013)} | 1160 | 0.8183 | ⬚ |
\text{6 (June 2013)} | 609 | 0.4296 | ⬚ |
\text{7 (Sept 2013)} | 1139 | 0.8035 | ⬚ |
\text{8 (Dec 2013)} | 2762 | 1.9485 | ⬚ |
\text{9 (March 2014)} | 1795 | 0.9638 | ⬚ |
\text{10 (June 2014)} | 1181 | 0.6341 | ⬚ |
\text{11 (Sept 2014)} | 1094 | 0.5874 | ⬚ |
\text{12 (Dec 2014)} | 3380 | 1.8148 | ⬚ |
Calculate the seasonal component for the quarters ending in March, June, September, and December, rounding to four decimal places if necessary.
March | June | September | December |
---|---|---|---|
⬚ | ⬚ | ⬚ | ⬚ |
Deseasonalise the data in the table and fill in the last column. Round off to the nearest whole air conditioner sold.
Use your calculator to calculate the least squares regression line that fits the deseasonalised data, rounding values to a single decimal place if necessary.
Give the equation of the line in the form y=at+b.
Predict the number of air conditioners sold in the quarter ending December 2015.
Round off to the nearest whole air conditioner sold.
Comment on the reliability of your prediction.
If asked to comment on the reliability of the prediction, consider whether the future time value is close to the data.