This case study examines a time series data set that tracks the monthly electric production in kilowatt-hours (kWh) from January 1973 to December 2010 for the state of New South Wales, Australia. The data set contains 456 observations. This data set was retrieved from kaggle and uploaded to github. The data is available through the following link: https://raw.githubusercontent.com/JackRoss10089/STA-321/main/Electric_Production.csv. The goal of this case study is to fit three different smoothing models to this time series and test which model produces the most accurate forecast.
After retrieving the data from github, we must next prepare the data set for analysis. First we must reduce the data set to the 150 most recent observations. Then we remove the date variable from the data set as we do not need it to utilize the ts function. We will hold up the 12 most recent observations as test data and use the other observations as training data.
Once we have established a training and a testing data set, we can fit various models to this data and test which model has the best accuracy.
| ME | RMSE | MAE | MPE | MAPE | MASE | ACF1 | |
|---|---|---|---|---|---|---|---|
| SES | 0.0388 | 9.2776 | 7.9652 | -0.3788 | 7.8211 | 2.6357 | 0.3831 |
| Holt Linear | -0.5174 | 9.4375 | 8.1484 | -1.3546 | 8.1100 | 2.6963 | 0.4974 |
| Holt Add. Damped | 0.1448 | 9.2898 | 8.0084 | -0.2761 | 7.8589 | 2.6499 | 0.3770 |
| Holt Exp. Damped | 0.2076 | 9.2854 | 8.0036 | -0.2129 | 7.8521 | 2.6484 | 0.3767 |
| HW Add. | -0.0832 | 2.7349 | 2.1651 | -0.1357 | 2.1235 | 0.7164 | 0.1087 |
| HW Exp. | -0.0235 | 2.7998 | 2.1595 | -0.0938 | 2.0850 | 0.7146 | 0.4585 |
| HW Add. Damp | -0.0412 | 2.7413 | 2.1696 | -0.0895 | 2.1264 | 0.7179 | 0.1172 |
| HW Exp. Damp | 0.0536 | 2.6764 | 2.1124 | 0.0117 | 2.0616 | 0.6990 | 0.0968 |
Based upon the accuracy metrics for the models we have created, the Holt-Winters Exponential Damped model is the most accurate for forecasting the time series values of this data. We chose this model because it has the smallest MAPE.
Next we will generate plots for the time series data.
We can see from the above accuracy table that HW’s linear trend with an exponential damped seasonal model is the best of the eight smoothing models. This is consistent with the patterns in the original serial plot.
Since we train the model with the training data and identify the best model using both training and testing data. Both methods yield the same results. To use the model for real-forecast, we need to refit the model using the entire data to update the smoothing parameters in the final working model.
| MSE | MAPE | |
|---|---|---|
| SES | 256.99435 | 12.292823 |
| Holt.Add | 120.88805 | 8.308310 |
| Holt.Add.Damp | 257.01307 | 12.293376 |
| Holt.Exp | 257.18050 | 12.298275 |
| HW.Add | 23.70792 | 2.961139 |
| HW.Exp | 24.34709 | 3.093022 |
| HW.Add.Damp | 25.48505 | 3.122989 |
| HW.Exp.Damp | 25.63821 | 3.206257 |
| x | |
|---|---|
| alpha | 0.5235809 |
| beta | 0.0001033 |
| gamma | 0.0001112 |
In summary, the updated values of the three smoothing parameters in the Holt-Winters linear trend and with exponentially damped seasonality using the entire data are given in the above table.