forked from robjhyndman/fpp3_slides
/
3-5-official-decom.Rmd
99 lines (77 loc) · 2.38 KB
/
3-5-official-decom.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: "3. Time series decomposition"
author: "3.5 Methods used in official statistics"
date: "OTexts.org/fpp3/"
classoption: aspectratio=169
titlepage: fpp3title.png
titlecolor: fpp3red
toc: false
output:
binb::monash:
colortheme: monashwhite
fig_width: 7.5
fig_height: 3
keep_tex: no
includes:
in_header: fpp3header.tex
---
```{r setup, include=FALSE}
source("setup.R")
us_retail_employment <- us_employment |>
filter(year(Month) >= 1990, Title == "Retail Trade") |>
select(-Series_ID)
```
## History of time series decomposition
\fontsize{13}{15}\sf
* Classical method originated in 1920s.
* Census II method introduced in 1957. Basis for X-11 method and variants (including X-12-ARIMA, X-13-ARIMA)
* STL method introduced in 1983
* TRAMO/SEATS introduced in 1990s.
\pause
### 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
## X-11 decomposition
```{r, fig.height=3.6, fig.width=9}
x11_dcmp <- us_retail_employment |>
model(x11 = X_13ARIMA_SEATS(Employed ~ x11())) |>
components()
autoplot(x11_dcmp)
```
## X-11 decomposition
**Advantages**
* Relatively robust to outliers
* Completely automated choices for trend and seasonal changes
* Very widely tested on economic data over a long period of time.
\pause
**Disadvantages**
* No prediction/confidence intervals
* Ad hoc method with no underlying model
* Only developed for quarterly and monthly data
## Extensions: X-12-ARIMA and X-13-ARIMA
* The X-11, X-12-ARIMA and X-13-ARIMA methods are based on Census II decomposition.
* These allow adjustments for trading days and other explanatory variables.
* Known outliers can be omitted.
* Level shifts and ramp effects can be modelled.
* Missing values estimated and replaced.
* Holiday factors (e.g., Easter, Labour Day) can be estimated.
## X-13ARIMA-SEATS
```{r, fig.height=3.6, fig.width=9}
seats_dcmp <- us_retail_employment |>
model(seats = X_13ARIMA_SEATS(Employed ~ seats())) |>
components()
autoplot(seats_dcmp)
```
## X-13ARIMA-SEATS
**Advantages**
* Model-based
* Smooth trend estimate
* Allows estimates at end points
* Allows changing seasonality
* Developed for economic data
\pause
**Disadvantages**
* Only developed for quarterly and monthly data