+ All Categories
Home > Documents > Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift...

Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift...

Date post: 20-Mar-2018
Category:
Upload: hoanganh
View: 217 times
Download: 2 times
Share this document with a friend
59
Forecasting using 10. Seasonal ARIMA models OTexts.com/fpp/8/9 Forecasting using R 1 Rob J Hyndman
Transcript
Page 1: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Forecasting using

10. Seasonal ARIMA models

OTexts.com/fpp/8/9

Forecasting using R 1

Rob J Hyndman

Page 2: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Outline

1 Backshift notation

2 Seasonal ARIMA models

3 Example 1: European quarterly retail trade

4 Example 2: Australian cortecosteroid drugsales

5 ARIMA vs ETS

Forecasting using R Backshift notation 2

Page 3: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notationA very useful notational device is the backwardshift operator, B, which is used as follows:

Byt = yt−1 .

In other words, B, operating on yt, has the effect ofshifting the data back one period. Twoapplications of B to yt shifts the data back twoperiods:

B(Byt) = B2yt = yt−2 .

For monthly data, if we wish to shift attention to“the same month last year,” then B12 is used, andthe notation is B12yt = yt−12.

Forecasting using R Backshift notation 3

Page 4: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notationA very useful notational device is the backwardshift operator, B, which is used as follows:

Byt = yt−1 .

In other words, B, operating on yt, has the effect ofshifting the data back one period. Twoapplications of B to yt shifts the data back twoperiods:

B(Byt) = B2yt = yt−2 .

For monthly data, if we wish to shift attention to“the same month last year,” then B12 is used, andthe notation is B12yt = yt−12.

Forecasting using R Backshift notation 3

Page 5: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notationA very useful notational device is the backwardshift operator, B, which is used as follows:

Byt = yt−1 .

In other words, B, operating on yt, has the effect ofshifting the data back one period. Twoapplications of B to yt shifts the data back twoperiods:

B(Byt) = B2yt = yt−2 .

For monthly data, if we wish to shift attention to“the same month last year,” then B12 is used, andthe notation is B12yt = yt−12.

Forecasting using R Backshift notation 3

Page 6: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notationA very useful notational device is the backwardshift operator, B, which is used as follows:

Byt = yt−1 .

In other words, B, operating on yt, has the effect ofshifting the data back one period. Twoapplications of B to yt shifts the data back twoperiods:

B(Byt) = B2yt = yt−2 .

For monthly data, if we wish to shift attention to“the same month last year,” then B12 is used, andthe notation is B12yt = yt−12.

Forecasting using R Backshift notation 3

Page 7: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation

First difference: 1− B.

Double difference: (1− B)2.

dth-order difference: (1− B)dyt.

Seasonal difference: 1− Bm.

Seasonal difference followed by a firstdifference: (1− B)(1− Bm).

Multiply terms together together to see thecombined effect:

(1− B)(1− Bm)yt = (1− B− Bm + Bm+1)yt= yt − yt−1 − yt−m + yt−m−1.

Forecasting using R Backshift notation 4

Page 8: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation

First difference: 1− B.

Double difference: (1− B)2.

dth-order difference: (1− B)dyt.

Seasonal difference: 1− Bm.

Seasonal difference followed by a firstdifference: (1− B)(1− Bm).

Multiply terms together together to see thecombined effect:

(1− B)(1− Bm)yt = (1− B− Bm + Bm+1)yt= yt − yt−1 − yt−m + yt−m−1.

Forecasting using R Backshift notation 4

Page 9: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation

First difference: 1− B.

Double difference: (1− B)2.

dth-order difference: (1− B)dyt.

Seasonal difference: 1− Bm.

Seasonal difference followed by a firstdifference: (1− B)(1− Bm).

Multiply terms together together to see thecombined effect:

(1− B)(1− Bm)yt = (1− B− Bm + Bm+1)yt= yt − yt−1 − yt−m + yt−m−1.

Forecasting using R Backshift notation 4

Page 10: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation

First difference: 1− B.

Double difference: (1− B)2.

dth-order difference: (1− B)dyt.

Seasonal difference: 1− Bm.

Seasonal difference followed by a firstdifference: (1− B)(1− Bm).

Multiply terms together together to see thecombined effect:

(1− B)(1− Bm)yt = (1− B− Bm + Bm+1)yt= yt − yt−1 − yt−m + yt−m−1.

Forecasting using R Backshift notation 4

Page 11: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation

First difference: 1− B.

Double difference: (1− B)2.

dth-order difference: (1− B)dyt.

Seasonal difference: 1− Bm.

Seasonal difference followed by a firstdifference: (1− B)(1− Bm).

Multiply terms together together to see thecombined effect:

(1− B)(1− Bm)yt = (1− B− Bm + Bm+1)yt= yt − yt−1 − yt−m + yt−m−1.

Forecasting using R Backshift notation 4

Page 12: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation

First difference: 1− B.

Double difference: (1− B)2.

dth-order difference: (1− B)dyt.

Seasonal difference: 1− Bm.

Seasonal difference followed by a firstdifference: (1− B)(1− Bm).

Multiply terms together together to see thecombined effect:

(1− B)(1− Bm)yt = (1− B− Bm + Bm+1)yt= yt − yt−1 − yt−m + yt−m−1.

Forecasting using R Backshift notation 4

Page 13: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation for ARIMA

ARMA model:yt = c + φ1yt−1 + · · ·+ φpyt−p + et + θ1et−1 + · · ·+ θqet−q

= c + φ1Byt + · · ·+ φpBpyt + et + θ1Bet + · · ·+ θqB

qet

φ(B)yt = c + θ(B)et

where φ(B) = 1− φ1B− · · · − φpBp

and θ(B) = 1 + θ1B + · · ·+ θqBq.

ARIMA(1,1,1) model:

(1− φ1B) (1− B)yt = c + (1 + θ1B)et

Forecasting using R Backshift notation 5

Page 14: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation for ARIMA

ARMA model:yt = c + φ1yt−1 + · · ·+ φpyt−p + et + θ1et−1 + · · ·+ θqet−q

= c + φ1Byt + · · ·+ φpBpyt + et + θ1Bet + · · ·+ θqB

qet

φ(B)yt = c + θ(B)et

where φ(B) = 1− φ1B− · · · − φpBp

and θ(B) = 1 + θ1B + · · ·+ θqBq.

ARIMA(1,1,1) model:

(1− φ1B) (1− B)yt = c + (1 + θ1B)et

Forecasting using R Backshift notation 5

Page 15: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation for ARIMA

ARMA model:yt = c + φ1yt−1 + · · ·+ φpyt−p + et + θ1et−1 + · · ·+ θqet−q

= c + φ1Byt + · · ·+ φpBpyt + et + θ1Bet + · · ·+ θqB

qet

φ(B)yt = c + θ(B)et

where φ(B) = 1− φ1B− · · · − φpBp

and θ(B) = 1 + θ1B + · · ·+ θqBq.

ARIMA(1,1,1) model:

(1− φ1B) (1− B)yt = c + (1 + θ1B)et↑

Firstdifference

Forecasting using R Backshift notation 5

Page 16: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation for ARIMA

ARMA model:yt = c + φ1yt−1 + · · ·+ φpyt−p + et + θ1et−1 + · · ·+ θqet−q

= c + φ1Byt + · · ·+ φpBpyt + et + θ1Bet + · · ·+ θqB

qet

φ(B)yt = c + θ(B)et

where φ(B) = 1− φ1B− · · · − φpBp

and θ(B) = 1 + θ1B + · · ·+ θqBq.

ARIMA(1,1,1) model:

(1− φ1B) (1− B)yt = c + (1 + θ1B)et↑

AR(1)

Forecasting using R Backshift notation 5

Page 17: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Backshift notation for ARIMA

ARMA model:yt = c + φ1yt−1 + · · ·+ φpyt−p + et + θ1et−1 + · · ·+ θqet−q

= c + φ1Byt + · · ·+ φpBpyt + et + θ1Bet + · · ·+ θqB

qet

φ(B)yt = c + θ(B)et

where φ(B) = 1− φ1B− · · · − φpBp

and θ(B) = 1 + θ1B + · · ·+ θqBq.

ARIMA(1,1,1) model:

(1− φ1B) (1− B)yt = c + (1 + θ1B)et↑

MA(1)

Forecasting using R Backshift notation 5

Page 18: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Outline

1 Backshift notation

2 Seasonal ARIMA models

3 Example 1: European quarterly retail trade

4 Example 2: Australian cortecosteroid drugsales

5 ARIMA vs ETS

Forecasting using R Seasonal ARIMA models 6

Page 19: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA models

ARIMA (p,d,q) (P,D,Q)m

where m = number of periods per season.

Forecasting using R Seasonal ARIMA models 7

Page 20: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA models

ARIMA (p,d,q)︸ ︷︷ ︸ (P,D,Q)m

↑ Non-seasonalpart of themodel

where m = number of periods per season.

Forecasting using R Seasonal ARIMA models 7

Page 21: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA models

ARIMA (p,d,q) (P,D,Q)m︸ ︷︷ ︸↑ Seasonal

part ofthemodel

where m = number of periods per season.

Forecasting using R Seasonal ARIMA models 7

Page 22: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

Forecasting using R Seasonal ARIMA models 8

Page 23: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

Forecasting using R Seasonal ARIMA models 8

Page 24: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

6

(Seasonaldifference

)

Forecasting using R Seasonal ARIMA models 8

Page 25: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

6(Non-seasonal

difference

)

Forecasting using R Seasonal ARIMA models 8

Page 26: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

6

(Seasonal

AR(1)

)

Forecasting using R Seasonal ARIMA models 8

Page 27: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

6(Non-seasonal

AR(1)

)

Forecasting using R Seasonal ARIMA models 8

Page 28: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

6

(Seasonal

MA(1)

)

Forecasting using R Seasonal ARIMA models 8

Page 29: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Seasonal ARIMA modelsE.g., ARIMA(1,1,1)(1,1,1)4 model (without constant)

(1− φ1B)(1−Φ1B4)(1− B)(1− B4)yt = (1 + θ1B)(1 + Θ1B

4)et.

6(Non-seasonal

MA(1)

)

Forecasting using R Seasonal ARIMA models 8

Page 30: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Outline

1 Backshift notation

2 Seasonal ARIMA models

3 Example 1: European quarterly retail trade

4 Example 2: Australian cortecosteroid drugsales

5 ARIMA vs ETS

Forecasting using R Example 1: European quarterly retail trade 9

Page 31: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

European quarterly retail trade

Forecasting using R Example 1: European quarterly retail trade 10

Year

Ret

ail i

ndex

2000 2005 2010

9092

9496

9810

010

2

Page 32: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

European quarterly retail trade

Forecasting using R Example 1: European quarterly retail trade 10

Year

Ret

ail i

ndex

2000 2005 2010

9092

9496

9810

010

2

> plot(euretail)

Page 33: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

European quarterly retail trade

> auto.arima(euretail)ARIMA(1,1,1)(0,1,1)[4]

Coefficients:ar1 ma1 sma1

0.8828 -0.5208 -0.9704s.e. 0.1424 0.1755 0.6792

sigma^2 estimated as 0.1411: log likelihood=-30.19AIC=68.37 AICc=69.11 BIC=76.68

Forecasting using R Example 1: European quarterly retail trade 11

Page 34: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

European quarterly retail trade

> auto.arima(euretail, stepwise=FALSE,approximation=FALSE)

ARIMA(0,1,3)(0,1,1)[4]

Coefficients:ma1 ma2 ma3 sma1

0.2625 0.3697 0.4194 -0.6615s.e. 0.1239 0.1260 0.1296 0.1555

sigma^2 estimated as 0.1451: log likelihood=-28.7AIC=67.4 AICc=68.53 BIC=77.78

Forecasting using R Example 1: European quarterly retail trade 12

Page 35: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

European quarterly retail trade

Forecasting using R Example 1: European quarterly retail trade 13

Forecasts from ARIMA(0,1,3)(0,1,1)[4]

2000 2005 2010 2015

9095

100

Page 36: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Outline

1 Backshift notation

2 Seasonal ARIMA models

3 Example 1: European quarterly retail trade

4 Example 2: Australian cortecosteroid drugsales

5 ARIMA vs ETS

Forecasting using RExample 2: Australian cortecosteroid drug

sales 14

Page 37: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Forecasting using RExample 2: Australian cortecosteroid drug

sales 15

Year

H02

sal

es (

mill

ion

scrip

ts)

1995 2000 2005

0.4

0.6

0.8

1.0

1.2

Year

Log

H02

sal

es

1995 2000 2005

−1.

0−

0.6

−0.

20.

2

Page 38: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

> fit <- auto.arima(h02, lambda=0)> fitARIMA(2,1,3)(0,1,1)[12]Box Cox transformation: lambda= 0

Coefficients:ar1 ar2 ma1 ma2 ma3 sma1

-1.0194 -0.8351 0.1717 0.2578 -0.4206 -0.6528s.e. 0.1648 0.1203 0.2079 0.1177 0.1060 0.0657

sigma^2 estimated as 0.004071: log likelihood=250.8AIC=-487.6 AICc=-486.99 BIC=-464.83

Forecasting using RExample 2: Australian cortecosteroid drug

sales 16

Page 39: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Forecasting using RExample 2: Australian cortecosteroid drug

sales 17

residuals(fit)

1995 2000 2005

−0.

2−

0.1

0.0

0.1

0.2

●●●●●●●●●●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

0 5 10 15 20 25 30 35

−0.

20.

00.

2

Lag

AC

F

0 5 10 15 20 25 30 35

−0.

20.

00.

2

Lag

PAC

F

Page 40: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Training: July 91 – June 06

Test: July 06 – June 08

Forecasting using RExample 2: Australian cortecosteroid drug

sales 18

Model RMSE

ARIMA(3,0,0)(2,1,0)12 0.0661ARIMA(3,0,1)(2,1,0)12 0.0646ARIMA(3,0,2)(2,1,0)12 0.0645ARIMA(3,0,1)(1,1,0)12 0.0679ARIMA(3,0,1)(0,1,1)12 0.0644ARIMA(3,0,1)(0,1,2)12 0.0622ARIMA(3,0,1)(1,1,1)12 0.0630ARIMA(4,0,3)(0,1,1)12 0.0648ARIMA(3,0,3)(0,1,1)12 0.0640ARIMA(4,0,2)(0,1,1)12 0.0648ARIMA(3,0,2)(0,1,1)12 0.0644ARIMA(2,1,3)(0,1,1)12 0.0634ARIMA(2,1,4)(0,1,1)12 0.0632ARIMA(2,1,5)(0,1,1)12 0.0640

Page 41: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Training: July 91 – June 06

Test: July 06 – June 08

Forecasting using RExample 2: Australian cortecosteroid drug

sales 18

Model RMSE

ARIMA(3,0,0)(2,1,0)12 0.0661ARIMA(3,0,1)(2,1,0)12 0.0646ARIMA(3,0,2)(2,1,0)12 0.0645ARIMA(3,0,1)(1,1,0)12 0.0679ARIMA(3,0,1)(0,1,1)12 0.0644ARIMA(3,0,1)(0,1,2)12 0.0622ARIMA(3,0,1)(1,1,1)12 0.0630ARIMA(4,0,3)(0,1,1)12 0.0648ARIMA(3,0,3)(0,1,1)12 0.0640ARIMA(4,0,2)(0,1,1)12 0.0648ARIMA(3,0,2)(0,1,1)12 0.0644ARIMA(2,1,3)(0,1,1)12 0.0634ARIMA(2,1,4)(0,1,1)12 0.0632ARIMA(2,1,5)(0,1,1)12 0.0640

Page 42: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

getrmse <- function(x,h,...){

train.end <- time(x)[length(x)-h]test.start <- time(x)[length(x)-h+1]train <- window(x,end=train.end)test <- window(x,start=test.start)fit <- Arima(train,...)fc <- forecast(fit,h=h)return(accuracy(fc,test)["RMSE"])

}

Forecasting using RExample 2: Australian cortecosteroid drug

sales 19

Page 43: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

getrmse(h02,h=24,order=c(3,0,0),seasonal=c(2,1,0),lambda=0)getrmse(h02,h=24,order=c(3,0,1),seasonal=c(2,1,0),lambda=0)getrmse(h02,h=24,order=c(3,0,2),seasonal=c(2,1,0),lambda=0)getrmse(h02,h=24,order=c(3,0,1),seasonal=c(1,1,0),lambda=0)getrmse(h02,h=24,order=c(3,0,1),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(3,0,1),seasonal=c(0,1,2),lambda=0)getrmse(h02,h=24,order=c(3,0,1),seasonal=c(1,1,1),lambda=0)getrmse(h02,h=24,order=c(4,0,3),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(3,0,3),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(4,0,2),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(3,0,2),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(2,1,3),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(2,1,4),seasonal=c(0,1,1),lambda=0)getrmse(h02,h=24,order=c(2,1,5),seasonal=c(0,1,1),lambda=0)

Forecasting using RExample 2: Australian cortecosteroid drug

sales 20

Page 44: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Models with lowest AICc values tend to giveslightly better results than the other models.

AICc comparisons must have the same ordersof differencing. But RMSE test set comparisonscan involve any models.

No model passes all the residual tests.

Use the best model available, even if it doesnot pass all tests.

Forecasting using RExample 2: Australian cortecosteroid drug

sales 21

Page 45: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Models with lowest AICc values tend to giveslightly better results than the other models.

AICc comparisons must have the same ordersof differencing. But RMSE test set comparisonscan involve any models.

No model passes all the residual tests.

Use the best model available, even if it doesnot pass all tests.

Forecasting using RExample 2: Australian cortecosteroid drug

sales 21

Page 46: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Models with lowest AICc values tend to giveslightly better results than the other models.

AICc comparisons must have the same ordersof differencing. But RMSE test set comparisonscan involve any models.

No model passes all the residual tests.

Use the best model available, even if it doesnot pass all tests.

Forecasting using RExample 2: Australian cortecosteroid drug

sales 21

Page 47: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Models with lowest AICc values tend to giveslightly better results than the other models.

AICc comparisons must have the same ordersof differencing. But RMSE test set comparisonscan involve any models.

No model passes all the residual tests.

Use the best model available, even if it doesnot pass all tests.

Forecasting using RExample 2: Australian cortecosteroid drug

sales 21

Page 48: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Cortecosteroid drug sales

Forecasting using RExample 2: Australian cortecosteroid drug

sales 22

Forecasts from ARIMA(3,0,1)(0,1,2)[12]

Year

H02

sal

es (

mill

ion

scrip

ts)

1995 2000 2005 2010

0.4

0.6

0.8

1.0

1.2

1.4

1.6

Page 49: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

Outline

1 Backshift notation

2 Seasonal ARIMA models

3 Example 1: European quarterly retail trade

4 Example 2: Australian cortecosteroid drugsales

5 ARIMA vs ETS

Forecasting using R ARIMA vs ETS 23

Page 50: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

ARIMA vs ETS

Myth that ARIMA models are more general thanexponential smoothing.

Linear exponential smoothing models allspecial cases of ARIMA models.

Non-linear exponential smoothing models haveno equivalent ARIMA counterparts.

Many ARIMA models have no exponentialsmoothing counterparts.

ETS models all non-stationary. Models withseasonality or non-damped trend (or both)have two unit roots; all other models have oneunit root.

Forecasting using R ARIMA vs ETS 24

Page 51: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

ARIMA vs ETS

Myth that ARIMA models are more general thanexponential smoothing.

Linear exponential smoothing models allspecial cases of ARIMA models.

Non-linear exponential smoothing models haveno equivalent ARIMA counterparts.

Many ARIMA models have no exponentialsmoothing counterparts.

ETS models all non-stationary. Models withseasonality or non-damped trend (or both)have two unit roots; all other models have oneunit root.

Forecasting using R ARIMA vs ETS 24

Page 52: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

ARIMA vs ETS

Myth that ARIMA models are more general thanexponential smoothing.

Linear exponential smoothing models allspecial cases of ARIMA models.

Non-linear exponential smoothing models haveno equivalent ARIMA counterparts.

Many ARIMA models have no exponentialsmoothing counterparts.

ETS models all non-stationary. Models withseasonality or non-damped trend (or both)have two unit roots; all other models have oneunit root.

Forecasting using R ARIMA vs ETS 24

Page 53: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

ARIMA vs ETS

Myth that ARIMA models are more general thanexponential smoothing.

Linear exponential smoothing models allspecial cases of ARIMA models.

Non-linear exponential smoothing models haveno equivalent ARIMA counterparts.

Many ARIMA models have no exponentialsmoothing counterparts.

ETS models all non-stationary. Models withseasonality or non-damped trend (or both)have two unit roots; all other models have oneunit root.

Forecasting using R ARIMA vs ETS 24

Page 54: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

ARIMA vs ETS

Myth that ARIMA models are more general thanexponential smoothing.

Linear exponential smoothing models allspecial cases of ARIMA models.

Non-linear exponential smoothing models haveno equivalent ARIMA counterparts.

Many ARIMA models have no exponentialsmoothing counterparts.

ETS models all non-stationary. Models withseasonality or non-damped trend (or both)have two unit roots; all other models have oneunit root.

Forecasting using R ARIMA vs ETS 24

Page 55: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

EquivalencesSimple exponential smoothing

Forecasts equivalent to ARIMA(0,1,1).Parameters: θ1 = α− 1.

Holt’s method

Forecasts equivalent to ARIMA(0,2,2).Parameters: θ1 = α + β − 2 and θ2 = 1− α.

Damped Holt’s 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 + 1parameters whereas HW uses only three parameters.

Holt-Winters’ multiplicative method

No ARIMA equivalenceForecasting using R ARIMA vs ETS 25

Page 56: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

EquivalencesSimple exponential smoothing

Forecasts equivalent to ARIMA(0,1,1).Parameters: θ1 = α− 1.

Holt’s method

Forecasts equivalent to ARIMA(0,2,2).Parameters: θ1 = α + β − 2 and θ2 = 1− α.

Damped Holt’s 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 + 1parameters whereas HW uses only three parameters.

Holt-Winters’ multiplicative method

No ARIMA equivalenceForecasting using R ARIMA vs ETS 25

Page 57: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

EquivalencesSimple exponential smoothing

Forecasts equivalent to ARIMA(0,1,1).Parameters: θ1 = α− 1.

Holt’s method

Forecasts equivalent to ARIMA(0,2,2).Parameters: θ1 = α + β − 2 and θ2 = 1− α.

Damped Holt’s 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 + 1parameters whereas HW uses only three parameters.

Holt-Winters’ multiplicative method

No ARIMA equivalenceForecasting using R ARIMA vs ETS 25

Page 58: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

EquivalencesSimple exponential smoothing

Forecasts equivalent to ARIMA(0,1,1).Parameters: θ1 = α− 1.

Holt’s method

Forecasts equivalent to ARIMA(0,2,2).Parameters: θ1 = α + β − 2 and θ2 = 1− α.

Damped Holt’s 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 + 1parameters whereas HW uses only three parameters.

Holt-Winters’ multiplicative method

No ARIMA equivalenceForecasting using R ARIMA vs ETS 25

Page 59: Forecasting using - Rob J Hyndman · PDF file · 2014-01-21Outline 1Backshift notation 2Seasonal ARIMA models 3Example 1: European quarterly retail trade 4Example 2: Australian cortecosteroid

EquivalencesSimple exponential smoothing

Forecasts equivalent to ARIMA(0,1,1).Parameters: θ1 = α− 1.

Holt’s method

Forecasts equivalent to ARIMA(0,2,2).Parameters: θ1 = α + β − 2 and θ2 = 1− α.

Damped Holt’s 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 + 1parameters whereas HW uses only three parameters.

Holt-Winters’ multiplicative method

No ARIMA equivalenceForecasting using R ARIMA vs ETS 25


Recommended