Section 1. Use the elecdaily data (daily electricity demand for Victoria, Australia, during
2014) for question 1 – 4.
The data for the first 20 days can be obtained as follows.
daily20 <- head(elecdaily,20)
1. Plot the data and find the regression model for Demand with temperature as an explanatory
variable. Why is there a positive relationship?
Regression model: demand = 212.38 + 0.41*temperature
The positive relationship is because there is increased demand for electricity when the temperature
rises. This might be due to increased demand for cooling that requires electricity.
2. Produce a residual plot. Is the model adequate? Are there any outliers or influential
observations?
The model fails to reject the null hypothesis of the Breusch-Godfrey test with a p-value of 2.2e-16.
There are a few outliers as seen in the residual distribution on the right side of the distribution.
3. Use the model to forecast the electricity demand that you would expect for the next day if
the maximum temperature was 15∘ and compare it with the forecast if the with maximum
temperature was 35∘. Do you believe these forecasts?
15 degree forecast
35 degrees forecast
Given the uncertainty bands on the forecasts both are possible but unlikely, meaning the forecasts
are not particularly believable.
4. Plot Demand vs Temperature for all of the available data in elecdaily. What does this say
about your model?
This plot shows the model likely isn’t a linear relationship between demand and temperature. The
data for lower temperatures suggests that demand and temperature can have a negative
relationship if the temperature is low enough.
Section 2. Use the bricksq data (Australian quarterly clay brick production. 1956–1994) for
question 5-11.
5. Use an STL decomposition to calculate the trend-cycle and seasonal indices. (Experiment
with having fixed or changing seasonality.)
trend-cycle
Seasonal
6. Compute and plot the seasonally adjusted data.
7. Use a naïve method to produce forecasts of the seasonally adjusted data.
8. Use stlf() to reseasonalise the results, giving forecasts for the original data.
9. Do the residuals look uncorrelated?
The residuals do not appear uncorrelated.
10. Repeat with a robust STL decomposition. Does it make much difference?
Stl without robust
Robust stl
Comparing the two decompositions not much has changed by making the decomposition robust.
The trend is slightly smoother in the robust decomposition and the seasonality changed slightly.
11. Compare forecasts from stlf() with those from snaive(), using a test set comprising the last
2 years of data. Which is better?
The RMSE of 19.74 for the stlf method (48.71 for snaive) suggests that the stlf forecast is the better
one.
Section 3. Use data set ukcars (the quarterly UK passenger vehicle production data from
1977Q1–2005Q1) for question 12-19.
12. Plot the data and describe the main features of the series.
The annual variation in the data suggests there might be a seasonal component. The data initially
trended downwards until ~1981 when it began to trend upwards until ~2000. Around the year 2000
a sharp decline in production occurred. Production rebounded a few quarters later but no
significant positive or negative trend shows from the limited data past that point.
13. Decompose the series using STL and obtain the seasonally adjusted data.
14. Forecast the next two years of the series using an additive damped trend method applied to
the seasonally adjusted data. (This can be done in one step using stlf() with
arguments etsmodel="AAN", damped=TRUE.)
15. Forecast the next two years of the series using Holt’s linear method applied to the
seasonally adjusted data (as before but with damped=FALSE).
16. Now use ets() to choose a seasonal model for the data.
17. Compare the RMSE of the ETS model with the RMSE of the models you obtained using
STL decompositions. Which gives the better in-sample fits?
Comparing the RMSE of the ETS model with the RMSE of the models obtained using STL, the RMSE
of the ETS model is higher than that of the RMSE of the model ran with stlf. Therefore, the model
with the additive damped trend method provides the better in-sample fit.
18. Compare the forecasts from the three approaches? Which seems most reasonable?
Both the ETS model and the model with the additive damped trend method provide forecasts that
best reflect the variation in the data. The Holt linear model forecast does not reflect the variation in
the data well. Given the RMSE values and the inspection of the forecasts the additive damped trend
method seems the most reasonable.
19. Check the residuals of your preferred model.
Residuals appear normally distributed, ACF reflects the seasonality in the data, data appears
stationary.
Section 4. Use dataset austourists (the quarterly visitor nights (in millions) spent by
international tourists to Australia for the period 1999–2015) for question 20-23.
20. What can you learn from the ACF graph?
From the ACF graph we can see that the ACF decays and there is a seasonal spike every 4 quarters.
The decaying ACF means differencing the data may be useful in model selection.
21. What can you learn from the PACF graph?
The PACF graph shows an AR process in the data.
22. Produce ACF and PACF plots of the seasonally differenced data (1−B4)Yt. What model
do these graphs suggest?
These graphs suggest a model of ARIMA(3,2,0)
23. Does auto.arima() give the same model that you chose? If not, which model do you think
is better?
auto.arima gives a model of (1,1,0), so it is different from the one I’ve chosen. The auto.arima model
has a lower AIC of 292.97 compared to an AIC of 355.14 in my model. Given the lower AIC I believe
the auto.arima model is better than the one I’ve chosen.
Section 5. Use data set huron (the level of Lake Huron from 1875–1972) for question 24-25.
24. Fit a piecewise linear trend model to the Lake Huron data with a knot at 1920 and an
ARMA error structure.
25. Forecast the level for the next 30 years.