















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















































Ch3. Time series decomposition
OTexts.org/fpp3/
Recall
Trend pattern exists when there is a long-term increase or decrease in the data. Cyclic pattern exists when data exhibit rises and falls that are not of fixed period (duration usually of at least 2 years). Seasonal pattern exists when a series is influenced by seasonal factors (e.g., the quarter of the year, the month, or day of the week).
yt = f ( St , Tt , Rt )
where yt = data at period t Tt = trend-cycle component at period t St = seasonal component at period t Rt = remainder component at period t
Additive model appropriate if magnitude of seasonal fluctuations does not vary with level. If seasonal are proportional to level of series, then multiplicative model appropriate. Multiplicative decomposition more prevalent with economic series Alternative: use a Box-Cox transformation, and then use additive decomposition. Logs turn multiplicative relationship into an additive relationship:
yt = St × Tt × Et ⇒ log yt = log St + log Tt + log Rt. (^) 6
dcmp <- elecequip %>% model ( STL (value ~ season (window = 7))) dcmp
dcmp %>% components (season_year) %>% gg_subseries (value) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec STL(value ~ season(window = 7))
200020052010200020052010200020052010200020052010200020052010200020052010200020052010200020052010200020052010200020052010200020052010200020052010
60
80
100
120
index
value
autoplot (elecequip) + autolayer ( components (dcmp), trend)
60
80
100
120
(^2000) index [1M] 2005 2010
value
Useful by-product of decomposition: an easy way to calculate seasonally adjusted data. Additive decomposition: seasonally adjusted data given by yt − St = Tt + Rt Multiplicative decomposition: seasonally adjusted data given by yt /St = Tt × Rt
dcmp <- elecequip %>% model ( STL (value ~ season (window=7))) elecequip %>% autoplot (value) + autolayer ( components (dcmp), trend + remainder)
60
80
100
120
(^2000) index [1M] 2005 2010
value
Classical method originated in 1920s. Census II method introduced in 1957. Basis for X- method and variants (including X-12-ARIMA, X-13-ARIMA) STL method introduced in 1983 TRAMO/SEATS introduced in 1990s.
Classical method originated in 1920s. Census II method introduced in 1957. Basis for X- method and variants (including X-12-ARIMA, X-13-ARIMA) STL method introduced in 1983 TRAMO/SEATS introduced in 1990s. National Statistics Offices ABS uses X-12-ARIMA US Census Bureau uses X-13ARIMA-SEATS Statistics Canada uses X-12-ARIMA ONS (UK) uses X-12-ARIMA EuroStat use X-13ARIMA-SEATS (^15)
The first step in a classical decomposition is to use a moving average method to estimate the trend-cycle. A moving average of order m can be written as T^ ˆ t = 1 m
∑^ k j =− k
yt + j
where m = 2 k + 1. We call this an m -MA. The estimate of the trend-cycle at time t is obtained by averaging values of the time series within k periods of t. Observations that are nearby in time are also likely to be close in value. (^17)
global_economy %>% filter (Country == "Australia") %>% autoplot (Exports) + xlab ("Year") + ylab ("% of GDP") + ggtitle ("Total Australian exports")
12
15
18
21
(^1960 1980) Year 2000
% of GDP
Total Australian exports