Exercises 1,2,3,4,5,7,8,9
1. Consider the GDP information in global_economy. Plot the GDP per capita for each country over time.
There are too many time series to fit legibly on one plot. We can see, however, a general trend up.
1.b Which country has the highest GDP per capita? How has this changed over time?
We filter GDP per capita at 80,000 and find that Monaco has the highest GDP per capita, and has since the 1990s, with some brief exceptions when Liechtenstein led GDP per capita.
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:
The GDP per capita in the US appears to be increasing exponentially, so a log transformation seems appropriate. In fact, the log transformation is only mildly effective, though not entirely, effective.
2b. slaughter of Victorian “Bulls, bullocks and steers” in aus_livestock.
Here we can perform a box-cox transformation to create more linearity and stabilize variation. In fact, the box cox has little effect. We can also perform a moving average (11 months works well here) to isolate the trend from the seasonality.
## [1] -0.04461887
2.c Victorian Electricity Demand from vic_elec
For this dataset it is possible to do a moving average, but the variation renders it not very useful.
2.d Gas production from aus_production.
A boxcox with a .11 lambda helps make the curve more linear and significantly reduce variability.
## [1] 0.1095171
3. Why is a Box-Cox transformation unhelpful for the canadian_gas data?
A box cox transformation will make an uneven trend appear more linear. The trend already appears linear. In addition, the increase i variation is restricted to a particular region - it is does not rise continuously.
## # A tsibble: 6 x 2 [1M]
## Month Volume
## <mth> <dbl>
## 1 1960 Jan 1.43
## 2 1960 Feb 1.31
## 3 1960 Mar 1.40
## 4 1960 Apr 1.17
## 5 1960 May 1.12
## 6 1960 Jun 1.01
## [1] 0.5767648
4. What Box-Cox transformation would you select for your retail data (from Exercise 8 in Section 2.10)?
Using guerrerro, the best lambda is .22. The difference is moderate, maving the effect of smoothing out the large jump toward the end of the year.
## [1] 0.2247137
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.
## [1] 0.9264636
## [1] 1.999927
## [1] -0.2501616
7. Consider the last five years of the Gas data from aus_production. Plot the time series. Can you identify seasonal fluctuations and/or a trend-cycle?
The trend is upward - seasonality is very strong, peaking in the summer months.
7.b Use classical_decomposition with type=multiplicative to calculate the trend-cycle and seasonal indices.
7.c Do the results support the graphical interpretation from part a?
Yes, the results are supported.
7.d Compute and plot the seasonally adjusted data.
7.e 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? Does it make any difference if the outlier is near the end rather than in the middle of the time series?
Outliers have a significant effect on seasonal adjustment. However the effect is temporary, as it tends to wash out before and after the adjustment window. Early and late outliers have more effect snce they are not baanced in the same way.
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?
The decomposition reveals a number of things - seasonality is highest in the middle years of the series, not the end as I had thought, and there are some significant outliers in the 1990s.
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. 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?
The most significant element of the decomposition is the trend which increases linearly over time. There does not appear to be any cyclicality. This is followed by seasonality - there is a marked annual seasonality, in which March, September and December appear to be peak months, while Jan and August are low months. It is possible that laborers enter the market at harvest time (March), planting time (September), and for the holidays (December). Noise is a small component of the decomposition. The recession is found mainly in the noise element - it is barely perceptible as a slight flattening in the trend.