## 7.9 Exercises

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.

The

`fma::plastics`

data set consists of the monthly sales (in thousands) of product A for a plastics manufacturer for five years.- Plot the time series of sales of product A. Can you identify seasonal fluctuations and/or a trend-cycle?
- Use a classical multiplicative decomposition to calculate the trend-cycle and seasonal indices.
- Do the results support the graphical interpretation from part a?
- Compute and plot the seasonally adjusted data.
- 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?
- Does it make any difference if the outlier is near the end rather than in the middle of the time series?

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?

Figures 7.13 and 7.14 show the result of decomposing the number of persons in the civilian labour force in Australia each month from February 1978 to August 1995.

`#> Registered S3 method overwritten by 'xts': #> method from #> as.zoo.xts zoo #> Registered S3 method overwritten by 'quantmod': #> method from #> as.zoo.data.frame zoo #> Registered S3 methods overwritten by 'forecast': #> method from #> fitted.fracdiff fracdiff #> residuals.fracdiff fracdiff`

- Write about 3–5 sentences describing the results of the decomposition. Pay particular attention to the scales of the graphs in making your interpretation.
- Is the recession of 1991/1992 visible in the estimated components?

This exercise uses the

`expsmooth::cangas`

data (monthly Canadian gas production in billions of cubic metres, January 1960 – February 2005).- Plot the data using
`autoplot()`

,`gg_subseries()`

and`gg_season()`

to look at the effect of the changing seasonality over time. What do you think is causing it to change so much? - Do an STL decomposition of the data. You will need to choose a seasonal window to allow for the changing shape of the seasonal component.
- Compare the results with those obtained using SEATS and X11. How are they different?

- Plot the data using
We will use the bricks data from

`aus_production`

(Australian quarterly clay brick production. 1956–2005) for this exercise.- Use an STL decomposition to calculate the trend-cycle and seasonal indices. (Experiment with having fixed or changing seasonality.)
- Compute and plot the seasonally adjusted data.
- Use a naïve method to produce forecasts of the seasonally adjusted data.
- Use
`decomposition_model()`

to reseasonalise the results, giving forecasts for the original data. - Do the residuals look uncorrelated?
- Repeat with a robust STL decomposition. Does it make much difference?
- Compare forecasts from
`decomposition_model()`

with those from`SNAIVE()`

, using a test set comprising the last 2 years of data. Which is better?

Use

`decomposition_model()`

to produce forecasts of the`fma::writing`

series with either`NAIVE(season_adjust)`

or`RW(season_adjust ~ drift())`

, whichever is most appropriate. Use an appropriate transformation if required.Use

`decomposition_model()`

to produce forecasts of the`fma::fancy`

series with either`NAIVE(season_adjust)`

or`RW(season_adjust ~ drift())`

, whichever is most appropriate. Use an appropriate transformation if required.