Professional Documents
Culture Documents
Forecasting using
Forecasting using R
Outline
1 Backshift notation
2 Seasonal ARIMA models
3 Example 1: European quarterly retail trade
4 Example 2: Australian cortecosteroid drug
sales
5 ARIMA vs ETS
Forecasting using R
Backshift notation
Backshift notation
A very useful notational device is the backward
shift operator, B, which is used as follows:
Byt = yt1 .
In other words, B, operating on yt , has the effect of
shifting the data back one period. Two
applications of B to yt shifts the data back two
periods:
B(Byt ) = B2 yt = yt2 .
For monthly data, if we wish to shift attention to
the same month last year, then B12 is used, and
the notation is B12 yt = yt12 .
Forecasting using R
Backshift notation
Backshift notation
A very useful notational device is the backward
shift operator, B, which is used as follows:
Byt = yt1 .
In other words, B, operating on yt , has the effect of
shifting the data back one period. Two
applications of B to yt shifts the data back two
periods:
B(Byt ) = B2 yt = yt2 .
For monthly data, if we wish to shift attention to
the same month last year, then B12 is used, and
the notation is B12 yt = yt12 .
Forecasting using R
Backshift notation
Backshift notation
A very useful notational device is the backward
shift operator, B, which is used as follows:
Byt = yt1 .
In other words, B, operating on yt , has the effect of
shifting the data back one period. Two
applications of B to yt shifts the data back two
periods:
B(Byt ) = B2 yt = yt2 .
For monthly data, if we wish to shift attention to
the same month last year, then B12 is used, and
the notation is B12 yt = yt12 .
Forecasting using R
Backshift notation
Backshift notation
A very useful notational device is the backward
shift operator, B, which is used as follows:
Byt = yt1 .
In other words, B, operating on yt , has the effect of
shifting the data back one period. Two
applications of B to yt shifts the data back two
periods:
B(Byt ) = B2 yt = yt2 .
For monthly data, if we wish to shift attention to
the same month last year, then B12 is used, and
the notation is B12 yt = yt12 .
Forecasting using R
Backshift notation
Backshift notation
First difference: 1 B.
Double difference: (1 B)2 .
dth-order difference: (1 B)d yt .
Seasonal difference: 1 Bm .
Seasonal difference followed by a first
difference: (1 B)(1 Bm ).
Multiply terms together together to see the
combined effect:
Backshift notation
Backshift notation
First difference: 1 B.
Double difference: (1 B)2 .
dth-order difference: (1 B)d yt .
Seasonal difference: 1 Bm .
Seasonal difference followed by a first
difference: (1 B)(1 Bm ).
Multiply terms together together to see the
combined effect:
Backshift notation
Backshift notation
First difference: 1 B.
Double difference: (1 B)2 .
dth-order difference: (1 B)d yt .
Seasonal difference: 1 Bm .
Seasonal difference followed by a first
difference: (1 B)(1 Bm ).
Multiply terms together together to see the
combined effect:
Backshift notation
Backshift notation
First difference: 1 B.
Double difference: (1 B)2 .
dth-order difference: (1 B)d yt .
Seasonal difference: 1 Bm .
Seasonal difference followed by a first
difference: (1 B)(1 Bm ).
Multiply terms together together to see the
combined effect:
Backshift notation
Backshift notation
First difference: 1 B.
Double difference: (1 B)2 .
dth-order difference: (1 B)d yt .
Seasonal difference: 1 Bm .
Seasonal difference followed by a first
difference: (1 B)(1 Bm ).
Multiply terms together together to see the
combined effect:
Backshift notation
Backshift notation
First difference: 1 B.
Double difference: (1 B)2 .
dth-order difference: (1 B)d yt .
Seasonal difference: 1 Bm .
Seasonal difference followed by a first
difference: (1 B)(1 Bm ).
Multiply terms together together to see the
combined effect:
Backshift notation
= c + 1 Byt + + p Bp yt + et + 1 Bet + + q Bq et
(B)yt = c + (B)et
where (B) = 1 1 B p Bp
and (B) = 1 + 1 B + + q Bq .
ARIMA(1,1,1) model:
(1 1 B) (1 B)yt = c + (1 + 1 B)et
Forecasting using R
Backshift notation
= c + 1 Byt + + p Bp yt + et + 1 Bet + + q Bq et
(B)yt = c + (B)et
where (B) = 1 1 B p Bp
and (B) = 1 + 1 B + + q Bq .
ARIMA(1,1,1) model:
(1 1 B) (1 B)yt = c + (1 + 1 B)et
Forecasting using R
Backshift notation
= c + 1 Byt + + p Bp yt + et + 1 Bet + + q Bq et
(B)yt = c + (B)et
where (B) = 1 1 B p Bp
and (B) = 1 + 1 B + + q Bq .
ARIMA(1,1,1) model:
(1 1 B) (1 B)yt = c + (1 + 1 B)et
First
difference
Forecasting using R
Backshift notation
= c + 1 Byt + + p Bp yt + et + 1 Bet + + q Bq et
(B)yt = c + (B)et
where (B) = 1 1 B p Bp
and (B) = 1 + 1 B + + q Bq .
ARIMA(1,1,1) model:
(1 1 B) (1 B)yt = c + (1 + 1 B)et
AR(1)
Forecasting using R
Backshift notation
= c + 1 Byt + + p Bp yt + et + 1 Bet + + q Bq et
(B)yt = c + (B)et
where (B) = 1 1 B p Bp
and (B) = 1 + 1 B + + q Bq .
ARIMA(1,1,1) model:
(1 1 B) (1 B)yt = c + (1 + 1 B)et
MA(1)
Forecasting using R
Backshift notation
Outline
1 Backshift notation
2 Seasonal ARIMA models
3 Example 1: European quarterly retail trade
4 Example 2: Australian cortecosteroid drug
sales
5 ARIMA vs ETS
Forecasting using R
Forecasting using R
| {z }
Nonseasonal
part of the
model
Forecasting using R
{z
Seasonal
part of
the
model
Forecasting using R
Forecasting using R
Forecasting using R
Seasonal
difference
Forecasting using R
Non-seasonal
difference
Forecasting using R
Seasonal
AR(1)
Forecasting using R
Non-seasonal
AR(1)
Forecasting using R
Forecasting using R
Seasonal
MA(1)
Forecasting using R
Non-seasonal
MA(1)
Outline
1 Backshift notation
2 Seasonal ARIMA models
3 Example 1: European quarterly retail trade
4 Example 2: Australian cortecosteroid drug
sales
5 ARIMA vs ETS
Forecasting using R
96
94
92
90
Retail index
98
100
102
2000
2005
2010
Year
Forecasting using R
10
> plot(euretail)
96
94
92
90
Retail index
98
100
102
2000
2005
2010
Year
Forecasting using R
10
sma1
-0.9704
0.6792
Forecasting using R
11
ma3
0.4194
0.1296
sma1
-0.6615
0.1555
Forecasting using R
12
90
95
100
2000
Forecasting using R
2005
2010
2015
13
Outline
1 Backshift notation
2 Seasonal ARIMA models
3 Example 1: European quarterly retail trade
4 Example 2: Australian cortecosteroid drug
sales
5 ARIMA vs ETS
Forecasting using R
14
1.2
1.0
0.8
0.6
0.4
1995
2000
2005
0.2
0.6
1.0
0.2
Year
1995
Forecasting using R
2000
2005
Year
Example 2: Australian cortecosteroid drug
sales
15
ar2
-0.8351
0.1203
ma1
0.1717
0.2079
ma2
0.2578
0.1177
ma3
-0.4206
0.1060
sma1
-0.6528
0.0657
Forecasting using R
16
residuals(fit)
0.1
0.0
0.2 0.1
2005
0.0
0.2
0.2
0.0
PACF
0.2
2000
0.2
1995
ACF
10
15
20
25
Lag
Forecasting using R
30
35
10
15
20
25
30
35
Lag
Example 2: Australian cortecosteroid drug
sales
17
July 06 June 08
Forecasting using R
Model
RMSE
ARIMA(3,0,0)(2,1,0)12
ARIMA(3,0,1)(2,1,0)12
ARIMA(3,0,2)(2,1,0)12
ARIMA(3,0,1)(1,1,0)12
ARIMA(3,0,1)(0,1,1)12
ARIMA(3,0,1)(0,1,2)12
ARIMA(3,0,1)(1,1,1)12
ARIMA(4,0,3)(0,1,1)12
ARIMA(3,0,3)(0,1,1)12
ARIMA(4,0,2)(0,1,1)12
ARIMA(3,0,2)(0,1,1)12
ARIMA(2,1,3)(0,1,1)12
ARIMA(2,1,4)(0,1,1)12
ARIMA(2,1,5)(0,1,1)12
0.0661
0.0646
0.0645
0.0679
0.0644
0.0622
0.0630
0.0648
0.0640
0.0648
0.0644
0.0634
0.0632
0.0640
18
July 06 June 08
Forecasting using R
Model
RMSE
ARIMA(3,0,0)(2,1,0)12
ARIMA(3,0,1)(2,1,0)12
ARIMA(3,0,2)(2,1,0)12
ARIMA(3,0,1)(1,1,0)12
ARIMA(3,0,1)(0,1,1)12
ARIMA(3,0,1)(0,1,2)12
ARIMA(3,0,1)(1,1,1)12
ARIMA(4,0,3)(0,1,1)12
ARIMA(3,0,3)(0,1,1)12
ARIMA(4,0,2)(0,1,1)12
ARIMA(3,0,2)(0,1,1)12
ARIMA(2,1,3)(0,1,1)12
ARIMA(2,1,4)(0,1,1)12
ARIMA(2,1,5)(0,1,1)12
0.0661
0.0646
0.0645
0.0679
0.0644
0.0622
0.0630
0.0648
0.0640
0.0648
0.0644
0.0634
0.0632
0.0640
18
Forecasting using R
19
Forecasting using R
20
Forecasting using R
21
Forecasting using R
21
Forecasting using R
21
Forecasting using R
21
1.4
1.2
1.0
0.8
0.6
0.4
1.6
1995
2000
2005
2010
Year
Forecasting using R
22
Outline
1 Backshift notation
2 Seasonal ARIMA models
3 Example 1: European quarterly retail trade
4 Example 2: Australian cortecosteroid drug
sales
5 ARIMA vs ETS
Forecasting using R
ARIMA vs ETS
23
ARIMA vs ETS
Myth that ARIMA models are more general than
exponential smoothing.
Linear exponential smoothing models all
special cases of ARIMA models.
Non-linear exponential smoothing models have
no equivalent ARIMA counterparts.
Many ARIMA models have no exponential
smoothing counterparts.
ETS models all non-stationary. Models with
seasonality or non-damped trend (or both)
have two unit roots; all other models have one
unit root.
Forecasting using R
ARIMA vs ETS
24
ARIMA vs ETS
Myth that ARIMA models are more general than
exponential smoothing.
Linear exponential smoothing models all
special cases of ARIMA models.
Non-linear exponential smoothing models have
no equivalent ARIMA counterparts.
Many ARIMA models have no exponential
smoothing counterparts.
ETS models all non-stationary. Models with
seasonality or non-damped trend (or both)
have two unit roots; all other models have one
unit root.
Forecasting using R
ARIMA vs ETS
24
ARIMA vs ETS
Myth that ARIMA models are more general than
exponential smoothing.
Linear exponential smoothing models all
special cases of ARIMA models.
Non-linear exponential smoothing models have
no equivalent ARIMA counterparts.
Many ARIMA models have no exponential
smoothing counterparts.
ETS models all non-stationary. Models with
seasonality or non-damped trend (or both)
have two unit roots; all other models have one
unit root.
Forecasting using R
ARIMA vs ETS
24
ARIMA vs ETS
Myth that ARIMA models are more general than
exponential smoothing.
Linear exponential smoothing models all
special cases of ARIMA models.
Non-linear exponential smoothing models have
no equivalent ARIMA counterparts.
Many ARIMA models have no exponential
smoothing counterparts.
ETS models all non-stationary. Models with
seasonality or non-damped trend (or both)
have two unit roots; all other models have one
unit root.
Forecasting using R
ARIMA vs ETS
24
ARIMA vs ETS
Myth that ARIMA models are more general than
exponential smoothing.
Linear exponential smoothing models all
special cases of ARIMA models.
Non-linear exponential smoothing models have
no equivalent ARIMA counterparts.
Many ARIMA models have no exponential
smoothing counterparts.
ETS models all non-stationary. Models with
seasonality or non-damped trend (or both)
have two unit roots; all other models have one
unit root.
Forecasting using R
ARIMA vs ETS
24
Equivalences
Simple exponential smoothing
Forecasts equivalent to ARIMA(0,1,1).
Parameters: 1 = 1.
Holts method
Forecasts equivalent to ARIMA(0,2,2).
Parameters: 1 = + 2 and 2 = 1 .
Damped Holts method
Forecasts equivalent to ARIMA(1,1,2).
Parameters: 1 = , 1 = + 2, 2 = (1 ).
Holt-Winters additive method
Forecasts equivalent to ARIMA(0,1,m+1)(0,1,0)m .
Parameter restrictions because ARIMA has m + 1
parameters whereas HW uses only three parameters.
Holt-Winters multiplicative method
No ARIMA equivalence
Forecasting using R
ARIMA vs ETS
25
Equivalences
Simple exponential smoothing
Forecasts equivalent to ARIMA(0,1,1).
Parameters: 1 = 1.
Holts method
Forecasts equivalent to ARIMA(0,2,2).
Parameters: 1 = + 2 and 2 = 1 .
Damped Holts method
Forecasts equivalent to ARIMA(1,1,2).
Parameters: 1 = , 1 = + 2, 2 = (1 ).
Holt-Winters additive method
Forecasts equivalent to ARIMA(0,1,m+1)(0,1,0)m .
Parameter restrictions because ARIMA has m + 1
parameters whereas HW uses only three parameters.
Holt-Winters multiplicative method
No ARIMA equivalence
Forecasting using R
ARIMA vs ETS
25
Equivalences
Simple exponential smoothing
Forecasts equivalent to ARIMA(0,1,1).
Parameters: 1 = 1.
Holts method
Forecasts equivalent to ARIMA(0,2,2).
Parameters: 1 = + 2 and 2 = 1 .
Damped Holts method
Forecasts equivalent to ARIMA(1,1,2).
Parameters: 1 = , 1 = + 2, 2 = (1 ).
Holt-Winters additive method
Forecasts equivalent to ARIMA(0,1,m+1)(0,1,0)m .
Parameter restrictions because ARIMA has m + 1
parameters whereas HW uses only three parameters.
Holt-Winters multiplicative method
No ARIMA equivalence
Forecasting using R
ARIMA vs ETS
25
Equivalences
Simple exponential smoothing
Forecasts equivalent to ARIMA(0,1,1).
Parameters: 1 = 1.
Holts method
Forecasts equivalent to ARIMA(0,2,2).
Parameters: 1 = + 2 and 2 = 1 .
Damped Holts method
Forecasts equivalent to ARIMA(1,1,2).
Parameters: 1 = , 1 = + 2, 2 = (1 ).
Holt-Winters additive method
Forecasts equivalent to ARIMA(0,1,m+1)(0,1,0)m .
Parameter restrictions because ARIMA has m + 1
parameters whereas HW uses only three parameters.
Holt-Winters multiplicative method
No ARIMA equivalence
Forecasting using R
ARIMA vs ETS
25
Equivalences
Simple exponential smoothing
Forecasts equivalent to ARIMA(0,1,1).
Parameters: 1 = 1.
Holts method
Forecasts equivalent to ARIMA(0,2,2).
Parameters: 1 = + 2 and 2 = 1 .
Damped Holts method
Forecasts equivalent to ARIMA(1,1,2).
Parameters: 1 = , 1 = + 2, 2 = (1 ).
Holt-Winters additive method
Forecasts equivalent to ARIMA(0,1,m+1)(0,1,0)m .
Parameter restrictions because ARIMA has m + 1
parameters whereas HW uses only three parameters.
Holt-Winters multiplicative method
No ARIMA equivalence
Forecasting using R
ARIMA vs ETS
25