Question 1

Consider the the number of pigs slaughtered in Victoria, available in the aus_livestock dataset.

  1. Use the ETS() function in R to estimate the equivalent model for simple exponential smoothing. Find the optimal values of \(\alpha\) and \(\ell_0\), and generate forecasts for the next four months (To plot the forecasting, you can plot starting from 2010)

  2. Compute a 95% prediction interval for the first forecast using \(\hat{y} \pm 1.96s\) where \(s\) is the standard deviation of the residuals. Compare your interval with the interval produced by R.

Question 2

Data set global_economy contains the annual Exports from many countries. Select one country to analyse.

  1. Plot the Exports series and discuss the main features of the data. And give a short perspective of the fluctuations of the exports of your country.

  2. Use an ETS(A,N,N) model to forecast the series, and plot the forecasts for the next 10 years

  3. Compute the RMSE values for the training data.

  4. Compare the results to those from an ETS(A,A,N) model. (Remember that the trended model is using one more parameter than the simpler model.) Discuss the merits of the two forecasting methods for this data set.

  5. Compare the forecasts from both methods. Which do you think is best?

Question 3

Forecast the Chinese GDP from the global_economy data set using an ETS model. Experiment with the various options in the ETS() function to see how much the forecasts change with damped trend, or with a Box-Cox transformation. Try to develop an intuition of what each is doing to the forecasts. Assume h=20 when forecasting, so you can clearly see the differences between the various options when plotting the forecasts.

Question 4

Find an ETS model for the Gas data from aus_production and forecast the next few years (h=36). Why is multiplicative seasonality necessary here? Experiment with making the trend damped. Does it improve the forecasts (check the residuals properties before forecasting)?

Question 5

Recall your retail time series data (If not, just generate your series by choosing your set.seed)

set.seed(12345678)
myseries <- aus_retail %>%
  filter(`Series ID` == sample(aus_retail$`Series ID`, 1))
myseries %>% autoplot(Turnover)

  1. Why is multiplicative seasonality necessary for this series?

  2. Apply Holt-Winters’ multiplicative method to the data. Experiment with making the trend damped. Forecast assuming h=36

  3. Compare the RMSE of the one-step forecasts from the two methods. Which do you prefer?

  4. Check that the residuals from the best method look like white noise.

  5. Now find the test set RMSE, while training the model to the end of 2010. Can you beat the seasonal naive approach?

Question 6

Compute the total domestic overnight trips across Australia from the tourism dataset.

  1. Plot the data and describe the main features of the series.

  2. Decompose the series using STL and obtain the seasonally adjusted data.

  3. Forecast the next two years of the series using an additive damped trend method applied to the seasonally adjusted data. (This can be specified using decomposition_model().)

For example, you can use the following code

stletsdamped <- decomposition_model(
  STL(Trips),
  ETS(season_adjust ~ error("A") + trend("Ad") + season("N")))
  1. Forecast the next two years of the series using an appropriate model for holter linear method applied to the seasonally adjusted data (as before but without damped trend).

  2. Now use ETS() to choose a seasonal model for the data.

  3. Compare the RMSE of the ETS model with the RMSE of the models you obtained using STL decomposition. Which gives the better in-sample fits?

  4. Compare the forecasts from the three approaches? Which seems most reasonable?

  5. Check the residuals of your preferred model.

Question 7

For this exercise use the quarterly number of arrivals to Australia from New Zealand, 1981 Q1 – 2012 Q3, from data set aus_arrivals.

  1. Make a time plot of your data and describe the main features of the series.

  2. Create a training set that withholds the last two years of available data. Forecast the test set using an appropriate model for Holt-winter multiplicative method.

  3. Why is multiplicative seasonality necessary here?

  4. Forecast the two-year test set using each of the following methods (plot all the model without PI): i) an ETS model; ii) a ETS model applied to a log transformed series; iii) a seasonal naive method; iv) an STL decomposition applied to the log transformed data followed by an ETS model applied to the seasonally adjusted (transformed) data.

  5. Which method gives the best forecasts? Does it pass the residual tests?

  6. Compare the same four methods using time series cross-validation instead of using a training and test set. Do you come to the same conclusions(assume step-size and forecast = 3 to reduce computation time and initial fold size = 36)?

Question 8

  1. Apply cross-validation techniques to produce 1 year ahead ETS and seasonal naive forecasts for Portland cement production (from aus_production). initial size of 5 years, and increment the window by one observation.

  2. Compute the MSE of the resulting \(4\)-step-ahead errors. Comment on which forecasts are more accurate. Is this what you expected? (challenging)

Extra

Write your own function to implement simple exponential smoothing. The function should take arguments y (the response data), alpha (the smoothing parameter \(\alpha\)) and level (the initial level \(\ell_0\)). It should return the forecast of the next observation in the series. Does it give the same forecast as ETS() in question 1?

Modify your function from the previous exercise to return the sum of squared errors rather than the forecast of the next observation. Then use the optim() function to find the optimal values of \(\alpha\) and \(\ell_0\). Do you get the same values as the ETS() function?

Combine your previous two functions to produce a function that both finds the optimal values of \(\alpha\) and \(\ell_0\), and produces a forecast of the next observation in the series.