## 6.9 Exercises

1. Show that a $$3\times5$$ MA is equivalent to a 7-term weighted moving average with weights of 0.067, 0.133, 0.200, 0.200, 0.200, 0.133, and 0.067.

2. The plastics data set consists of the monthly sales (in thousands) of product A for a plastics manufacturer for five years.
1. Plot the time series of sales of product A. Can you identify seasonal fluctuations and/or a trend-cycle?
2. Use a classical multiplicative decomposition to calculate the trend-cycle and seasonal indices.
3. Do the results support the graphical interpretation from part a?
4. Compute and plot the seasonally adjusted data.
5. Change one observation to be an outlier (e.g., add 500 to one observation), and recompute the seasonally adjusted data. What is the effect of the outlier?
6. Does it make any difference if the outlier is near the end rather than in the middle of the time series?
3. Recall your retail time series data (from Exercise 3 in Section 2.10). Decompose the series using X11. Does it reveal any outliers, or unusual features that you had not noticed previously?

4. Figures 6.16 and 6.17 show the result of decomposing the number of persons in the civilian labor force in Australia each month from February 1978 to August 1995.

1. Write about 3–5 sentences describing the results of the decomposition. Pay particular attention to the scales of the graphs in making your interpretation.
2. Is the recession of 1991/1992 visible in the estimated components?
1. This exercise uses the cangas data (monthly Canadian gas production in billions of cubic metres, January 1960 – February 2005).
1. Plot the data using autoplot(), ggsubseriesplot() and ggseasonplot() to look at the effect of the changing seasonality over time. What do you think is causing it to change so much?
2. Do an STL decomposition of the data. You will need to choose s.window to allow for the changing shape of the seasonal component.
3. Compare the results with those obtained using SEATS and X11. How are they different?
2. We will use the bricksq data (Australian quarterly clay brick production. 1956–1994) for this exercise.
1. Use an STL decomposition to calculate the trend-cycle and seasonal indices. (Experiment with having fixed or changing seasonality.)
2. Compute and plot the seasonally adjusted data.
3. Use a naïve method to produce forecasts of the seasonally adjusted data.
4. Use stlf() to reseasonalize the results, giving forecasts for the original data.
5. Do the residuals look uncorrelated?
6. Repeat with a robust STL decomposition. Does it make much difference?
7. Compare forecasts from stlf() with those from snaive(), using a test set comprising the last 2 years of data. Which is better?
3. Use stlf() to produce forecasts of the writing series with either method="naive" or method="rwdrift", whichever is most appropriate. Use the lambda argument if you think a Box-Cox transformation is required.

4. Use stlf() to produce forecasts of the fancy series with either method="naive" or method="rwdrift", whichever is most appropriate. Use the lambda argument if you think a Box-Cox transformation is required.