## 3.7 Exercises

1. Consider the GDP information in global_economy. Plot the GDP per capita for each country over time. Which country has the highest GDP per capita? How has this changed over time?

2. For each of the following series, make a graph of the data. If transforming seems appropriate, do so and describe the effect.

• United States GDP from global_economy.
• Slaughter of Victorian “Bulls, bullocks and steers” in aus_livestock.
• Victorian Electricity Demand from vic_elec.
• Gas production from aus_production.
3. Why is a Box-Cox transformation unhelpful for the canadian_gas data?

4. What Box-Cox transformation would you select for your retail data (from Exercise 8 in Section 2.10)?

5. For the following series, find an appropriate Box-Cox transformation in order to stabilise the variance. Tobacco from aus_production, Economy class passengers between Melbourne and Sydney from ansett, and Pedestrian counts at Southern Cross Station from pedestrian.

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

7. Consider the last five years of the Gas data from aus_production.

gas <- tail(aus_production, 5*4) %>% select(Gas)
1. Plot the time series. Can you identify seasonal fluctuations and/or a trend-cycle?
2. Use classical_decomposition with type=multiplicative 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 300 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?
8. Recall your retail time series data (from Exercise 8 in Section 2.10). Decompose the series using X-11. Does it reveal any outliers, or unusual features that you had not noticed previously?

9. Figures 3.19 and 3.20 show the result of decomposing the number of persons in the civilian labour 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?
10. This exercise uses the canadian_gas 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.1
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. How does the seasonal shape change over time? [Hint: Try plotting the seasonal component using gg_season().]
4. Can you produce a plausible seasonally adjusted series?
5. Compare the results with those obtained using SEATS and X-11. How are they different?

1. The evolving seasonal pattern is possibly due to changes in the regulation of gas prices — thanks to Lewis Kirvan for pointing this out.↩︎