Week 3: Time series decomposition
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-class activities
Read Chapter 3 of the textbook and watch all embedded videos
Exercises (on your own or in tutorial)
Complete Exercises 6-11 from Section 2.10 of the book.
Slides for seminar
Seminar activities
Produce an STL decomposition as follows
<- us_employment |> us_construction filter(Title == "Construction", year(Month) > 1980) <- us_construction |> dcmp model(stl = STL(Employed ~ trend(window = 9) + season(window = 11))) |> components() |> autoplot() dcmp
What happens as you change the values of the two
window
arguments?How does the seasonal shape change over time? [Hint: Try plotting the seasonal component using
gg_season
.]Can you produce a plausible seasonally adjusted series? [Hint:
season_adjust
is returned bycomponents()
.]
Assignments
- Assignment 2 is due on Sunday 24 March.