BF-08

16
Business Forecasting ECON2209 Slides 08 Lecturer: Minxian Yang BF-08 1 my, School of Economics, UNSW

description

slides

Transcript of BF-08

Page 1: BF-08

Business Forecasting ECON2209

Slides 08

Lecturer: Minxian Yang

BF-08 1 my, School of Economics, UNSW

Page 2: BF-08

Ch.9 Forecasting Cycles

• Lecture Plan – Big picture:

– Optimal forecast and linear forecast – Forecasting general linear processes – Forecasting ARMA processes with the chain rule – Long run forecasts

BF-08 my, School of Economics, UNSW 2

0)(E ,0 , ,1

===++= ∑=

++ t

p

kkttpttttt xsssxsmy

Page 3: BF-08

Ch.9 Forecasting Cycles

Forecasting Cycles (Ch.9) • Optimal forecast

– As parameters can be estimated, we assume that parameters in ARMA models are known for now. At T, we wish to forecast the SP (or cycle) at T+h.

– Information set ΩT = yT, yT-1, …. When models are well-defined, ΩT = yT, yT-1, …; εT, εT-1, ….

– Forecast for yT+h based on ΩT: yT+h|T . – Expected quadratic loss (MSFE):

BF-08 my, School of Economics, UNSW 3

].Ω|)[(E)(MSFE 2|| TThThTThT yyy +++ −=

Page 4: BF-08

Ch.9 Forecasting Cycles

• Optimal forecast – Optimal forecast under MSFE is the conditional

mean of yT+h, yT+h|T = E(yT+h|ΩT), which minimises MSFE.

eg. ARMA(1,1) optimal forecast and forecast error Actual: Forecast: F. Error:

BF-08 my, School of Economics, UNSW 4

,1111 TTTT ycy εθεϕ +++= ++

,)Ω|( 111|1 TTTTTT εθyφcyEy ++== ++

;1|1 ++ = TTTe ε eT+1|T = yT+1 – yT+1|T

Page 5: BF-08

Ch.9 Forecasting Cycles

• Optimal forecast eg. ARMA(1,1) forecast (continued)

BF-08 my, School of Economics, UNSW 5

,112112 ++++ +++= TTTT ycy εθεϕ

,)|()|( |11112|2 TTTTTTTT ycyEcyEy ++++ +=Ω+=Ω= ϕϕ

.|11112|2 TTTTTT ee ++++ ++= ϕεθε Forecast error = yT+2 – yT+2|T

.,

,

|21213|3

|21|3

213213

TTTTTT

TTTT

TTTT

eeycy

ycy

++++

++

++++

++=

+=+++=

ϕεθε

ϕεθεϕ

Forecast error = yT+3 – yT+3|T

Page 6: BF-08

Ch.9 Forecasting Cycles

• Optimal forecast – Linear forecast: a linear combination of the

elements in ΩT. A linear forecast may be different from E(yT+h|ΩT).

– Best linear forecast (aka. linear projection):

with βs being chosen to minimise MSFE. – If the true model (dgp) is ARMA, the linear

projection coincides with E(yT+h|ΩT). – In general, the linear projection may be used as an

approximation to E(yT+h|ΩT).

BF-08 my, School of Economics, UNSW 6

+++= −+ 1210| TTThT yyy βββ

Page 7: BF-08

Ch.9 Forecasting Cycles

• Forecasting a general linear process – General linear process (cf. Wold representation)

– With the information ΩT = εT, εT-1, …, the Linear projection is

yT+h|T = bhεT + bh+1εT-1 + …

BF-08 my, School of Economics, UNSW 7

).,0(WN~ 1, , 20

0σεε t

iitit bby ==∑

=−

. |

|

:forecast

11

:error forecast

1111

ThT

ThT

y

ThTh

e

ThhThThT

bb

bby

+

+

+++

+++=

−+

+−−+++

εε

εεε

ΩT

yT+h

yT+h|T

eT+h|T

Page 8: BF-08

Ch.9 Forecasting Cycles

• Forecasting a general linear process – Forecast error

– When h → ∞, yT+h|T → E(yT) and σh2 → Var(yT).

– 95% Interval forecast when εt ~ iid N(0, σ2) [ yT+h|T − 1.96σh , yT+h|T + 1.96σh ]

– Conditional density when εt ~ iid N(0, σ2) yT+h | ΩT ~ N(yT+h|T , σh

2)

BF-08 my, School of Economics, UNSW 8

anceerror vari .)1()Var(

unbiased ,0)()1MA( ,

2221|

2

|

1111|

σσ

εεε

hThTh

ThT

ThhThTThT

bbe

eEhbbe

+++==

=

−+++=

+

+

+−−+++

Chebyshev’s theorem:

P(Y outside kσ) ≤ 1/k2

Page 9: BF-08

Ch.9 Forecasting Cycles

• Making it feasible with ARMA – Use ARMA to produce a linear projection.

• When dgp is ARMA, the linear projection is optimal; • In general, the linear projection approximates

E(yT+h|ΩT) . – Use estimated ARMA parameters. For large

samples, uncertainty in estimates may be ignored.

– ARMA: future Y = terms in ΩT + terms outside ΩT. • Use a chain rule to separate the terms in ΩT and the

terms outside ΩT.

BF-08 my, School of Economics, UNSW 9

Page 10: BF-08

Ch.9 Forecasting Cycles

• Making it feasible with ARMA eg. ARMA(1,1) chain rule

BF-08 my, School of Economics, UNSW 10

;

,

,

1|1

11|1

1

inside

111

++

+

+

Ω

+

=

++=

+++=

TTT

TTTT

TTTT

e

ycy

ycyT

ε

εθϕ

εεθϕ

.,

,)(

|11112|2

|11|2

|11112

inside

|11

112|1|112

TTTTTT

TTTT

TTTTTT

TTTTTTT

eeycy

eyceycy

T

++++

++

+++

Ω

+

+++++

++=

+=

++++=

++++=

ϕεθε

ϕ

ϕεθεϕ

εθεϕ

yT+h = yT+h|T + eT+h|T

Page 11: BF-08

Ch.9 Forecasting Cycles

• Making it feasible with ARMA eg. ARMA(1,1) chain rule (continued)

BF-08 my, School of Economics, UNSW 11

2211|1

11|1

|1|11111

;

,,

σσε

εθφεθεφ

==

++=

+=+++=

++

+

++++

TTT

TTTT

TTTTTTTT

e

ycyeyycy

221

21

21

22112|11|2

|11|2

112|1|112

)1( ;

,,)(

σθσφσεθεφ

φεθεφ

++=++=

+=

++++=

++++

++

+++++

TTTTTT

TTTT

TTTTTTT

ee

ycyeycy

221

22

21

23213|21|3

|21|3

213|2|213

)1( ;

,,)(

σθσφσεθεφ

φεθεφ

++=++=

+=

++++=

++++

++

+++++

TTTTTT

TTTT

TTTTTTT

ee

ycyeycy

Page 12: BF-08

Ch.9 Forecasting Cycles

• eg. Canadian employment index: 61q1:94q4

BF-08 my, School of Economics, UNSW 12

80

85

90

95

100

105

110

115

1965 1970 1975 1980 1985 1990

Y

AIC: MA(0-4)

AIC: ARMA(3,1) SIC: ARMA(2,0)

AR(0-4)

SIC: MA(0-4)

AR(0-4)

Search within ARMA(4,4,)

Page 13: BF-08

Ch.9 Forecasting Cycles

• eg. Canadian employment index: 61q1:94q4

BF-08 my, School of Economics, UNSW 13

AIC: ARMA(3,1)

0

5

10

15

20

25

-4 -2 0 2 4 6

Series: ResidualsSample 1962Q1 1993Q4Observations 128

Mean 7.38e-05Median 0.041454Maximum 6.754276Minimum -3.629406Std. Dev. 1.412262Skewness 0.547303Kurtosis 6.518596

Jarque-Bera 72.41962Probability 0.000000-4

-2

0

2

4

6

8

80

90

100

110

120

1965 1970 1975 1980 1985 1990

Residual Actual Fitted

Page 14: BF-08

Ch.9 Forecasting Cycles

• eg. Canadian employment index: 61q1:94q4

BF-08 my, School of Economics, UNSW 14

80

84

88

92

96

100

104

108

112

116

1990 1992 1994 1996 1998 2000 2002 2004 2006

YYF

YF_UPYF_LO

Forecast 94M1-06M4: ARMA(3,1) Model

80

84

88

92

96

100

104

108

1990 1991 1992 1993 1994

Forecast 94M1-94M4: ARMA(3,1) Model

Forecasts: ARMA(3,1) For a stationary time series y, the long horizon point forecast is approximately the unconditional mean of y. Its forecast error variance is approximately the unconditional variance of y.

Page 15: BF-08

Ch.9 Forecasting Cycles

• EViews

BF-08 my, School of Economics, UNSW 15

'caemp.prg wfcreate(wf=null) q 1961:1 2010:4 smpl 1961:1 1994:4 read caemp.dat y 'Plots smpl 1961:1 1993:4 y.line y.correl(16) 'Selecting models within ARMA(4,4) smpl 1962:1 1993:4 matrix(5,5) aic matrix(5,5) sic ls y c sic(1,1)=@schwarz aic(1,1)=@aic ls y c ma(1) sic(1,2)=@schwarz aic(1,2)=@aic ls y c ma(1) ma(2) sic(1,3)=@schwarz aic(1,3)=@aic ls y c ma(1) ma(2) ma(3) sic(1,4)=@schwarz aic(1,4)=@aic ls y c ma(1) ma(2) ma(3) ma(4) sic(1,5)=@schwarz aic(1,5)=@aic

for !k=1 to 4 ls y c y(-1 to -!k) sic(!k+1,1)=@schwarz aic(!k+1,1)=@aic ls y c y(-1 to -!k) ma(1) sic(!k+1,2)=@schwarz aic(!k+1,2)=@aic ls y c y(-1 to -!k) ma(1) ma(2) sic(!k+1,3)=@schwarz aic(!k+1,3)=@aic ls y c y(-1 to -!k) ma(1) ma(2) ma(3) sic(!k+1,4)=@schwarz aic(!k+1,4)=@aic ls y c y(-1 to -!k) ma(1) ma(2) ma(3) ma(4) sic(!k+1,5)=@schwarz aic(!k+1,5)=@aic next aic.bar sic.bar 'Preferred models equation eq1.ls y c ar(1) ar(2) ar(3) ma(1) equation eq2.ls y c ar(1) ar(2)

'Checking residuals eq1.correl(10) eq1.hist 'Forecast exercise smpl 1962:1 1993:4 eq1.makeresids res genr yf=y-res smpl 1994:1 2006:4 eq1.forecast yhat se genr yf=yhat genr yf_up=yhat+1.96*se genr yf_lo=yhat-1.96*se smpl 1990:1 1994:4 group fig1 y yf yf_up yf_lo freeze(Figure1) fig1.line Figure1.draw(shade, bottom) 1994:1 1994:4 show Figure1 smpl 1990:1 2006:4 group fig2 y yf yf_up yf_lo freeze(Figure2) fig2.line Figure2.draw(shade, bottom) 1994:1 2006:4 show Figure2 stop

Use subsample 1962:1 1993:4 for model selection, so that models within ARMA(4,4) use the same sample size.

Page 16: BF-08

Ch.9 Forecasting Cycles

• Summary – Under MSFE, what is the optimal forecast? – What is a linear forecast? – What is the linear projection? – How do we find the point forecast and forecast

error from a general linear process? – Do you know how to use the chain rule to produce

point forecasts and forecast error variances for ARMA(1,1)?

– How do you make long horizon forecasts for a stationary time series?

BF-08 my, School of Economics, UNSW 16