You are on page 1of 16

Business Forecasting

ECON2209
Slides 08

Lecturer: Minxian Yang

BF-08

my, School of Economics, UNSW

Ch.9 Forecasting Cycles

Lecture Plan
Big picture:

yt = mt + st + xt ,

st + p = st ,

s
k =1

t +k

= 0,

E( xt ) = 0

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

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):
MSFE( yT + h|T ) = E[( yT + h yT + h|T ) 2 | T ].

BF-08

my, School of Economics, UNSW

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: yT +1 = c + 1 yT + T +1 + 1 T ,
Forecast: yT +1|T = E ( yT +1 | T ) = c + 1 yT + 1T ,
eT+1|T = yT+1 yT+1|T
F. Error: eT +1|T = T +1 ;

BF-08

my, School of Economics, UNSW

Ch.9 Forecasting Cycles

Optimal forecast
eg. ARMA(1,1) forecast (continued)
yT + 2 = c + 1 yT +1 + T + 2 + 1 T +1 ,
yT + 2|T = E ( yT + 2 | T ) = c + 1 E ( yT +1 | T ) = c + 1 yT +1|T ,
eT + 2|T = T + 2 + 1 T +1 + 1eT +1|T .

Forecast error = yT+2

yT+2|T

Forecast error = yT+3

yT+3|T

yT +3 = c + 1 yT + 2 + T +3 + 1 T + 2 ,
yT +3|T = c + 1 yT + 2|T ,
eT +3|T = T +3 + 1 T + 2 + 1eT + 2|T .

BF-08

my, School of Economics, UNSW

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):
yT + h|T = 0 + 1 yT + 2 yT 1 +
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

Ch.9 Forecasting Cycles

Forecasting a general linear process


General linear process (cf. Wold representation)

yt = bi t i ,
i =0

b0 = 1,

t ~ WN(0, 2 ).

With the information T = {T, T-1, }, the


Linear projection is
yT+h|T = bhT + bh+1T-1 +
yT + h = T + h + b1 T + h 1 + + bh 1 T +1

forecast error : eT + h|T

+ bh T + bh +1 T 1 + .

forecast : yT + h|T

BF-08

my, School of Economics, UNSW

eT+h|T

yT+h

yT+h|T

T
7

Ch.9 Forecasting Cycles

Forecasting a general linear process


Forecast error

eT + h|T = T + h + b1 T + h 1 + + bh 1 T +1 ,

MA(h 1)

E (eT + h|T ) = 0,

unbiased

h2 = Var(eT + h|T ) = (1 + b12 + + bh2 ) 2 . error variance

When h , yT+h|T E(yT) and h2 Var(yT).


95% Interval forecast when t ~ iid N(0, 2)
Chebyshevs theorem:
[ yT+h|T 1.96h , yT+h|T + 1.96h ]
Conditional density when t ~ iid N(0, 2)
yT+h | T ~ N(yT+h|T , h2)
BF-08

my, School of Economics, UNSW

P(Y outside k) 1/k2

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

Ch.9 Forecasting Cycles

Making it feasible with ARMA


eg. ARMA(1,1) chain rule
yT +1

inside T

= c + 1 yT + 1 T + T +1 ,

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

yT +1|T = c + 1 yT + 1 T ,
eT +1|T = T +1 ;
yT + 2 = c + 1 ( yT +1|T + eT +1|T ) + T + 2 + 1 T +1 ,
= c + 1 yT +1|T + T + 2 + 1 T +1 + 1eT +1|T

inside T

yT + 2|T = c + 1 yT +1|T ,
eT + 2|T = T + 2 + 1 T +1 + 1eT +1|T .
BF-08

my, School of Economics, UNSW

10

Ch.9 Forecasting Cycles

Making it feasible with ARMA


eg. ARMA(1,1) chain rule (continued)
yT +1 = c + 1 yT + T +1 + 1T = yT +1|T + eT +1|T ,
yT +1|T = c + 1 yT + 1T ,
eT +1|T = T +1 ;

12 = 2

yT + 2 = c + 1 ( yT +1|T + eT +1|T ) + T + 2 + 1T +1 ,
yT + 2|T = c + 1 yT +1|T ,
eT + 2|T = 1eT +1|T + T + 2 + 1T +1 ;

22 = 12 12 + (1 + 12 ) 2

yT +3 = c + 1 ( yT + 2|T + eT + 2|T ) + T +3 + 1T + 2 ,
yT +3|T = c + 1 yT + 2|T ,
eT +3|T = 1eT + 2|T + T +3 + 1T + 2 ;
BF-08

32 = 12 22 + (1 + 12 ) 2

my, School of Economics, UNSW

11

Ch.9 Forecasting Cycles

eg. Canadian employment index: 61q1:94q4


115
110
105
100
95
90
85
80
1965

1970

1975

1980

1985

1990

AR(0-4)

Search within
ARMA(4,4,)
AIC: MA(0-4)

AR(0-4)

AIC: ARMA(3,1)
SIC: ARMA(2,0)
BF-08

SIC: MA(0-4)

my, School of Economics, UNSW

12

Ch.9 Forecasting Cycles

eg. Canadian employment index: 61q1:94q4


AIC: ARMA(3,1)

120

25
Series: Residuals
Sample 1962Q1 1993Q4
Observations 128

110

20
100

8
6

90

15

4
80

10

7.38e-05
0.041454
6.754276
-3.629406
1.412262
0.547303
6.518596

Jarque-Bera
Probability

72.41962
0.000000

-2
-4
1965

1970

1975

1980

1985

1990

0
-4

Residual

BF-08

Mean
Median
Maximum
Minimum
Std. Dev.
Skewness
Kurtosis

Actual

-2

Fitted

my, School of Economics, UNSW

13

Ch.9 Forecasting Cycles

eg. Canadian employment index: 61q1:94q4


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.
Forecast 94M1-06M4: ARMA(3,1) Model

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

116

108

112

104

108
100

104

96

100

92

96
92

88

88
84

84
80

80
1990

1991

1992

1993

1994

1990 1992 1994 1996 1998 2000 2002 2004 2006


Y
YF

BF-08

my, School of Economics, UNSW

YF_UP
YF_LO

14

Ch.9 Forecasting Cycles

EViews
'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

BF-08

Use subsample 1962:1 1993:4


for model selection, so that
models within ARMA(4,4) use
the same sample size.
'Checking residuals
eq1.correl(10)
eq1.hist
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)

my, School of Economics, UNSW

'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

15

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