03 Time Series Decomposition - Rev
03 Time Series Decomposition - Rev
3
For Better Official Statistics
Time Series
5
For Better Official Statistics
Original Data
Seasonal Irregular Other Systematics
6
For Better Official Statistics
Trend Component
Trend
Underlying
behaviour of
the series
Will contain
long term
business cycles
7
For Better Official Statistics
8
For Better Official Statistics
9
For Better Official Statistics
Calendar Related
Effects
Seasonal Other Systematics
10
For Better Official Statistics
Length of Seasonal
✓Data triwulanan, berfluktuasi triwulanan Period of “Season” Number of
dan berulang setiap tahun Pattern Length “Seasons”
→ 1 tahun = 4 triwulan → s = 4 in Pattern
✓Data bulanan, berfluktuasi bulanan dan Week Day 7
berulang setiap tahun
Month Week 4–4½
→1 tahun = 12 bulan → s = 12
Month Day 28 – 31
✓Data mingguan, berfluktuasi mingguan dan
berulang setiap bulan Year Quarter 4
→1 bulan = 4 minggu → s = 4 Year Month 12
✓Data harian, berfluktuasi harian dan Year Week 52
berulang setiap pekan
→1 minggu = 7 hari → s = 7
12
For Better Official Statistics
13
For Better Official Statistics
Irregular Component
Irregular
14
For Better Official Statistics
16
For Better Official Statistics
Model Dekomposisi
Dengan mengasumsikan time series hanya terdiri dari tiga komponen, 𝒀𝒕 dapat
dituliskan sbb:
𝑌𝑡 = 𝑓 𝑇𝑡 , 𝑆𝑡 , 𝐼𝑡
di mana 𝑌𝑡 = data pada periode 𝑡
𝑇𝑡 = trend-cycle component pada periode 𝑡
𝑆𝑡 = seasonal component pada periode 𝑡
𝐼𝑡 = irregular component pada periode 𝑡
19
For Better Official Statistics
→ Dekomposisi Adititif
(Trend & Seasonal)
→ Constant Variability
→ Dekomposisi Multiplikatif
(Trend & Seasonal)
→ Variability Increasing
20
For Better Official Statistics
Permintaan listrik
minggguan di England dan
Wales pada Bulan April
2005 dan April 2013
21
For Better Official Statistics
Seasonal Adjustment
✓Useful by-product of decomposition: an easy way to calculate seasonally
adjusted data.
✓Seasonally adjusted data is useful to highlight variation due to the
underlying state of the economy rather than the seasonal variation
✓Additive decomposition: seasonally adjusted data given by
𝑌𝑡 − 𝑆𝑡 = 𝑇𝑡 + 𝐼𝑡
✓Multiplicative decomposition: seasonally adjusted data given by
𝑌𝑡
= 𝑇𝑡 × 𝐼𝑡
𝑆𝑡
22
For Better Official Statistics
23
For Better Official Statistics
▪ Singapore: https://tablebuilder.singstat.gov.sg/table/TS/M015651
24
TREND-CYCLE
ESTIMATION
For Better Official Statistics
26
For Better Official Statistics
Trend Linier
✓ The time series is modelled
with a straight line:
𝑇𝑡 = 𝑏0 + 𝑏1 𝑡
✓ It is the simplest model and
may suffice for short-run
forecasting or as a baseline
model
✓ Linear trend is fitted by using
ordinary least squares
formulas
✓ Note: instead of using the
actual time values (e.g., years),
use an index 𝑡 = 1, 2, …
27
For Better Official Statistics
Trend Kuadratik
✓ The time series is modelled
with a curve:
𝑇𝑡 = 𝑏0 + 𝑏1 𝑡 + 𝑏2 𝑡 2
✓ Fitting a quadratic model is a
way of checking for
nonlinearity
✓ If 𝑏0 does not differ
significantly from zero, then
the linear trend would suffice
28
For Better Official Statistics
Trend Eksponensial
✓ The time series is modelled
with an exponential function:
𝑇𝑡 = 𝑏0 𝑏1𝑡
✓ There may not be much
difference between a linear
and exponential model when
the growth rate is small and
the data set covers only a few
time periods
29
For Better Official Statistics
30
CLASSICAL
DECOMPOSITION
For Better Official Statistics
Classical Decomposition
✓ The classical decomposition method originating in the 1920s is a
relatively simple procedure, and forms the starting point for most
other methods of time series decomposition
✓ There are two forms of classical decomposition: an additive
decomposition and a multiplicative decomposition
✓ In classical decomposition, we assume that the seasonal component
is constant from year to year
✓ For multiplicative seasonality, the 𝑠 values that form the seasonal
component are sometimes called the “seasonal indices”
32
For Better Official Statistics
Additive Decomposition
Step 1
Compute the trend-cycle component 𝑇𝑡 using a (centered) moving
average: 𝑠 is even, use 2×𝑠−𝑀𝐴; 𝑠 is odd use, 𝑠−𝑀𝐴
Step 2
Calculate the detrended series: 𝑌𝑡 − 𝑇𝑡
Step 3
To estimate the seasonal component 𝑆መ𝑡 for each season, simply average
the detrended values for that season. These seasonal component values
are then adjusted to ensure that they add to zero
Step 4
The remainder component is calculated by subtracting the estimated
seasonal and trend-cycle components: 𝐼መ𝑡 = 𝑌𝑡 − 𝑇𝑡 − 𝑆መ𝑡
33
For Better Official Statistics
34
For Better Official Statistics
Multiplicative Decomposition
Step 1
Compute the trend-cycle component 𝑇𝑡 using a (centered) moving
average: 𝑠 is even, use 2×𝑠−𝑀𝐴; 𝑠 is odd use, 𝑠−𝑀𝐴
Step 2
Calculate the detrended series: 𝑌𝑡 Τ𝑇𝑡
Step 3
To estimate the seasonal component 𝑆መ𝑡 for each season, simply average
the detrended values for that season. These seasonal indexes are then
adjusted to ensure that they add to 𝑠
Step 4
The remainder component is calculated by dividing out the estimated
seasonal and trend-cycle components: 𝐼መ𝑡 = 𝑌𝑡 Τ𝑇𝑡 Τ𝑆መ𝑡
35
For Better Official Statistics
36
VARIOUS
DECOMPOSITION
METHODS
For Better Official Statistics
39
For Better Official Statistics
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
Disadvantages
✓No prediction/confidence intervals
✓Ad hoc method with no underlying model
✓Only developed for quarterly and monthly data
40
For Better Official Statistics
41
For Better Official Statistics
X-13ARIMA-SEATS
Advantages
✓Model-based
✓Smooth trend estimate
✓Allows estimates at end points
✓Allows changing seasonality
✓Developed for economic data
Disadvantages
✓Only developed for quarterly and monthly data
42
STL
DECOMPOSITION
For Better Official Statistics
STL Decomposition
✓ STL: “Seasonal and Trend decomposition using Loess”
✓ Very versatile and robust
✓ Unlike X-12-ARIMA, STL will handle any type of seasonality (daily, weekly, etc.)
✓ Seasonal component allowed to change over time, and rate of change controlled
by user
✓ Smoothness of trend-cycle also controlled by user
✓ Robust to outliers
✓ Not trading day or calendar adjustments
✓ Only additive
✓ Take logs to get multiplicative decomposition
✓ Use Box-Cox transformations to get other decompositions
44
For Better Official Statistics
45
For Better Official Statistics
46
TIME SERIES
DECOMPOSITION
WITH FOUR
COMPONENTS
For Better Official Statistics
Dekomposisi 4 Komponen
✓ Misalnya time series 𝒀𝒕 didekomposisi menjadi 4 komponen
termasuk komponen siklus 𝑪𝒕 dengan model multiplikatif sebagai
berikut:
𝒀𝒕 = 𝑻𝒕 × 𝑪𝒕 × 𝑺𝒕 × 𝑰𝒕
𝒀𝒕
= 𝑪𝒕 × 𝑰𝒕
𝑻𝒕 × 𝑺𝒕
✓ Rata-rata bergerak dapat digunakan untuk memuluskan
irregularities, sehingga hanya meninggalkan komponen siklus
✓ Siklus adalah suatu perubahan atau gelombang naik atau turun
yang terjadi pada periode yang tidak tetap (durasi biasanya
minimal 2 tahun)
48
For Better Official Statistics
Variasi Siklus
✓Kondisi perekonomian mengalami gelombang siklus,
contohnya :
▪ Resesi
▪ Pemulihan Mempunyai periode
▪ Ledakan - boom disebut lama siklus
▪ Krisis
49
For Better Official Statistics
Contoh Penghitungan
Trend Indeks
Musiman 3 − 𝑀𝐴
Linier
Catur- 𝑻∙𝑪∙𝑰
Tahun 𝑌 𝑇 𝑆 𝑻 ∙ 𝑪 ∙ 𝑰 = 𝒀ൗ𝑺 𝑪∙𝑰= 𝐶
wulan 𝑻
1 60 47.56
2005 2 65 53.47 100.00 65.00 121.56
3 70 59.39 100.00 70.00 117.87 117.75
1 75 65.31 100.90 74.33 113.82 113.58
2006 2 78 71.22 100.43 77.67 109.05 107.85
3 80 77.14 103.00 77.67 100.68 99.74
1 75 83.06 100.90 74.33 89.50 89.99
2007 2 68 88.97 95.77 71.00 79.80
3 70 94.89
Total 641
50
POLITEKNIK STATISTIKA STIS
For Better Official Statistics
Terima Kasih!