Questions

Question 1

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

  1. United States GDP from global_economy.
  2. Slaughter of Victorian “Bulls, bullocks and steers” in aus_livestock.
  3. Victorian Electricity Demand from vic_elec.
  4. Gas production from aus_production.

Question 2

Why is a Box-Cox transformation unhelpful for the canadian_gas data (volume)?

Question 3

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

Question 4

Show that a 3×5-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.

Question 5

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?

Question 6

Select one of the time series as follows (but choose your own seed value):

set.seed(12345678)
myseries <- aus_retail %>%
  filter(`Series ID` == sample(aus_retail$`Series ID`,1))

Decompose the series using X-11. Does it reveal any outliers, or unusual features that you had not noticed previously?

Question 7

The figures below 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?

Question 8

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.
  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 (and plot) a plausible seasonally adjusted series?
  5. Compare the results with those obtained using SEATS and X-11. How are they different?

Question 9

Considering the the industry type, Liquor retailing, from the aus_retail dataset since 2000

  1. Calculate the overall turnover across all states and plot the series
liquor<-aus_retail%>%
  filter(Industry == "Liquor retailing" & year(Month)>= 2000)%>%
  summarise(Turnover = sum(Turnover))

ggplot(data= liquor)+
  geom_line(aes(x=Month, y=Turnover))

  1. What would be the best moving average approach for this type of data?

  2. From answer 2, plot the chosen moving average along with the original data.

liquor <-liquor%>%
  mutate(`12-MA` = slider::slide_dbl(Turnover, mean,
                                    .before = 5, .after = 6, .complete = TRUE))%>%
  mutate(`2x12-MA` = slider::slide_dbl(`12-MA`, mean,
                                    .before = 1, .after = 0, .complete = TRUE))
liquor%>%
  autoplot(Turnover) +
  geom_line(aes(y =`2x12-MA`), colour = "#0072B2") +
  labs(y = "Liquor retailing Turnover",
       title = "Total AUS Liquor retailing Turnover")+
  guides(colour = guide_legend(title = "series"))
## Warning: Removed 12 row(s) containing missing values (geom_path).

Question 10

Explain the step-by-step how to employ the classical decomposition for both Additive and Multiplicative.