7.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 fma::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 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
    Decomposition of the number of persons in the civilian labour force in Australia each month from February 1978 to August 1995.

    Figure 7.13: Decomposition of the number of persons in the civilian labour force in Australia each month from February 1978 to August 1995.

    Seasonal component from the decomposition shown in the previous figure.

    Figure 7.14: Seasonal component from the decomposition shown in the previous figure.

    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 expsmooth::cangas data (monthly Canadian gas production in billions of cubic metres, January 1960 – February 2005).

    1. 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?
    2. 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.
    3. Compare the results with those obtained using SEATS and X11. How are they different?
  2. We will use the bricks data from aus_production (Australian quarterly clay brick production. 1956–2005) 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 decomposition_model() to reseasonalise 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 decomposition_model() with those from SNAIVE(), using a test set comprising the last 2 years of data. Which is better?
  3. 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.

  4. 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.