# 7.8 Exercises

- Data set
`books`

contains the daily sales of paperback and hardcover books at the same store. The task is to forecast the next four days’ sales for paperback and hardcover books (data set`books`

).- Plot the series and discuss the main features of the data.
- Use simple exponential smoothing with the
`ses`

function (setting`initial="simple"`

) and explore different values of $\alpha $ for the`paperback`

series. Record the within-sample SSE for the one-step forecasts. Plot SSE against $\alpha $ and find which value of $\alpha $ works best. What is the effect of $\alpha $ on the forecasts? - Now let
`ses`

select the optimal value of $\alpha $. Use this value to generate forecasts for the next four days. Compare your results with 2. - Repeat but with
`initial="optimal"`

. How much difference does an optimal initial level make? - Repeat steps (b)–(d) with the
`hardcover`

series.

- Apply Holt’s linear method to the
`paperback`

and`hardback`

series and compute four-day forecasts in each case.- Compare the SSE measures of Holt’s method for the two series to those of simple exponential smoothing in the previous question. Discuss the merits of the two forecasting methods for these data sets.
- Compare the forecasts for the two series using both methods. Which do you think is best?
- Calculate a 95% prediction interval for the first forecast for each series using both methods, assuming normal errors. Compare your forecasts with those produced by R.

- For this exercise, use the quarterly UK passenger vehicle production data from 1977:1--2005:1 (data set
`ukcars`

).- Plot the data and describe the main features of the series.
- Decompose the series using STL and obtain the seasonally adjusted data.
- Forecast the next two years of the series using an additive damped trend method applied to the seasonally adjusted data. Then reseasonalize the forecasts. Record the parameters of the method and report the RMSE of the one-step forecasts from your method.
- Forecast the next two years of the series using Holt's linear method applied to the seasonally adjusted data. Then reseasonalize the forecasts. Record the parameters of the method and report the RMSE of of the one-step forecasts from your method.
- Now use
`ets()`

to choose a seasonal model for the data. - Compare the RMSE of the fitted model with the RMSE of the model you obtained using an STL decomposition with Holt's method. Which gives the better in-sample fits?
- Compare the forecasts from the two approaches? Which seems most reasonable?

- For this exercise, use the monthly Australian short-term overseas visitors data, May 1985--April 2005. (Data set:
`visitors`

.)- Make a time plot of your data and describe the main features of the series.
- Forecast the next two years using Holt-Winters' multiplicative method.
- Why is multiplicative seasonality necessary here?
- Experiment with making the trend exponential and/or damped.
- Compare the RMSE of the one-step forecasts from the various methods. Which do you prefer?
- Now fit each of the following models to the same data:
- a multiplicative Holt-Winters' method;
- an ETS model;
- an additive ETS model applied to a Box-Cox transformed series;
- a seasonal naive method applied to the Box-Cox transformed series;
- an STL decomposition applied to the Box-Cox transformed data followed by an ETS model applied to the seasonally adjusted (transformed) data.

- For each model, look at the residual diagnostics and compare the forecasts for the next two years. Which do you prefer?

Copyright © 2017, OTexts. About - Contact - Help - Twitter - Terms of Service - Privacy Policy