# 8.11 Exercises

Figure 8.24: Left: ACF for a white noise series of 36 numbers. Middle: ACF for a white noise series of 360 numbers. Right: ACF for a white noise series of 1,000 numbers.

1. Figure 8.24 shows the ACFs for 36 random numbers, 360 random numbers and for 1,000 random numbers.
1. Explain the differences among these figures. Do they all indicate the data are white noise?
2. Why are the critical values at different distances from the mean of zero? Why are the autocorrelations different in each figure when they each refer to white noise?
2. A classic example of a non-stationary series is the daily closing IBM stock prices (data set ibmclose). Use R to plot the daily closing prices for IBM stock and the ACF and PACF. Explain how each plot shows the series is non-stationary and should be differenced.
3. For the following series, find an appropriate Box-Cox transformation and order of differencing in order to obtain stationary data.
1. usnetelec
2. usgdp
3. mcopper
4. enplanements
5. visitors
4. For the enplanements data, write down the differences you chose above using backshift operator notation.
5. Use R to simulate and plot some data from simple ARIMA models.
1. Use the following R code to generate data from an AR(1) model with $\phi _{1} = 0.6$ and $\sigma ^2=1$. The process starts with $y_0=0$.
R code
y <- ts(numeric(100))
e <- rnorm(100)
for(i in 2:100)
y[i] <- 0.6*y[i-1] + e[i]
2. Produce a time plot for the series. How does the plot change as you change $\phi _1$?
3. Write your own code to generate data from an MA(1) model with $\theta_{1} = 0.6$ and $\sigma^2=1$.
4. Produce a time plot for the series. How does the plot change as you change $\theta _1$?
5. Generate data from an ARMA(1,1) model with $\phi _{1}$ = 0.6 and $\theta _{1} = 0.6$ and $\sigma ^2=1$.
6. Generate data from an AR(2) model with $\phi_{1} =-0.8$ and $\phi_{2} = 0.3$ and $\sigma ^2=1$. (Note that these parameters will give a non-stationary series.)
7. Graph the latter two series and compare them.
6. Consider the number of women murdered each year (per 100,000 standard population) in the United States (data set wmurders).
1. By studying appropriate graphs of the series in R, find an appropriate ARIMA($p,d,q$) model for these data.
2. Should you include a constant in the model? Explain.
3. Write this model in terms of the backshift operator.
4. Fit the model using R and examine the residuals. Is the model satisfactory?
5. Forecast three times ahead. Check your forecasts by hand to make sure you know how they have been calculated.
6. Create a plot of the series with forecasts and prediction intervals for the next three periods shown.
7. Does auto.arima give the same model you have chosen? If not, which model do you think is better?
7. Consider the quarterly number of international tourists to Australia for the period 1999–2010. (Data set austourists.)
1. Describe the time plot.
2. What can you learn from the ACF graph?
3. What can you learn from the PACF graph?
4. Produce plots of the seasonally differenced data $(1 - B^{4})Y_{t}$. What model do these graphs suggest?
5. Does auto.arima give the same model that you chose? If not, which model do you think is better?
6. Write the model in terms of the backshift operator, and then without using the backshift operator.
8. Consider the total net generation of electricity (in billion kilowatt hours) by the U.S. electric industry (monthly for the period 1985–1996). (Data set usmelec.) In general there are two peaks per year: in mid-summer and mid-winter.
1. Examine the 12-month moving average of this series to see what kind of trend is involved.
2. Do the data need transforming? If so, find a suitable transformation.
3. Are the data stationary? If not, find an appropriate differencing which yields stationary data.
4. Identify a couple of ARIMA models that might be useful in describing the time series. Which of your models is the best according to their AIC values?
5. Estimate the parameters of your best model and do diagnostic testing on the residuals. Do the residuals resemble white noise? If not, try to find another ARIMA model which fits better.
6. Forecast the next 15 years of generation of electricity by the U.S. electric industry. Get the latest figures from http://data.is/zgRWCO to check on the accuracy of your forecasts.
7. How many years of forecasts do you think are sufficiently accurate to be usable?
9. For the mcopper data:
1. if necessary, find a suitable Box-Cox transformation for the data;
2. fit a suitable ARIMA model to the transformed data using auto.arima();
3. try some other plausible models by experimenting with the orders chosen;
4. choose what you think is the best model and check the residual diagnostics;
5. produce forecasts of your fitted model. Do the forecasts look reasonable?
6. compare the results with what you would obtain using ets() (with no transformation).
10. Choose one of the following seasonal time series: condmilk, hsales, uselec
1. Do the data need transforming? If so, find a suitable transformation.
2. Are the data stationary? If not, find an appropriate differencing which yields stationary data.
3. Identify a couple of ARIMA models that might be useful in describing the time series. Which of your models is the best according to their AIC values?
4. Estimate the parameters of your best model and do diagnostic testing on the residuals. Do the residuals resemble white noise? If not, try to find another ARIMA model which fits better.
5. Forecast the next 24 months of data using your preferred model.
6. Compare the forecasts obtained using ets().
11. For the same time series you used in exercise Q10, try using a non-seasonal model applied to the seasonally adjusted data obtained from STL. The stlf() function will make the calculations easy (with method="arima"). Compare the forecasts with those obtained in exercise Q10. Which do you think is the best approach?