Week 3: Time series decomposition
Tutorial exercises
- Complete Exercises 6, 7, 11 from Section 2.10 of the book.
- Tutorial learning objectives.
- Week 3 Tutorial Solution.html
What you will learn this week
- Transforming data to remove some sources of variation
- Decomposing a time series into trend-cycle, seasonal and remainder components
- Seasonal adjustment
Pre-seminar activities
Read Chapter 3 of the textbook and watch all embedded videos
Slides for seminar
Lectorial activities
Find an appropriate Box-Cox transformation in order to stabilise the variance for Gas production from
aus_production.Why is a Box-Cox transformation unhelpful for the
canadian_gasdata?Produce the following decomposition for the number (in thousands) of of people employed in Retail Trade in the US
us_retail_employment <- us_employment |> filter(year(Month) >= 1990, Title == "Retail Trade") |> select(-Series_ID) dcmp <- us_retail_employment |> model(stl = STL(Employed))Plot the decomposition.
Fit the trend component over the data [Hint: you can use
autolayer()to addtrendto the plot above.trendis one of the variables returned bySTL(). ]Fit the trend and the seasonally adjusted [Hint:
seas_adjustis one of the variables returned bySTL. ]How does the seasonal shape change over time? [Hint: Try plotting the seasonal component using
gg_season().]What happens as you change the values of the two
windowarguments?Can you produce a plausible seasonally adjusted series?
Exam 2024
- Section A: Q6 (just for information at the moment)
- Section B: Q1, Q2
Seminar code
Assignments
- GA1 is due on Monday 24 March.