You are on page 1of 27

3.

VAR: FORECASTING AND IMPULSE RESPONSE


FUNCTIONS
1
1 Forecasting with VAR models
We dene the Mean Square Error for a predictor of Y
t+h
, Y
t
(h) as
MSE(Y
t
(h)) = E[(Y
t+h
Y
t
(h))(Y
t+h
Y
t
(h))

]
In what follows we will consider predictor which are optimal in the sense that
they minimize the MSE, i.e. minimizes the MSE of each component of Y
t+h
.
Let us consider the VAR(p) in companion form
Y
t
= AY
t1
+ e
t
(1)
where e
t
is white noise. The h-step ahead predictor of Y
t+h
, Y
t
(h), conditional
on the information available at time t is given by
Y
t
(h) = A
h
Y
t
= AY
t
(h 1) (2)
where the rst n rows of Y
t
(h) represent the optimal forecast of Y
t+h
. From (37)
it is easy to compute recursively the forecast for Y
t+h
at any horizon, given given
by the rst n elements of Y
t
(h).
2
The predictor in the previous slide is optimal in the sense that it delivers the
minimum MSE among those that are linear functions of Y . To get the intuition
let us consider for instance a simple VAR(1) process
Y
t
= A
1
Y
t1
+ e
t
It follows that
Y
t+h
= A
h
1
Y
t
+
h1

i=0
A
i
1
e
t+hi
Thus for a predictor
Y
t
(h) = B
0
Y
t
+ B
1
Y
t1
+ ...
the forecast error is given by
Y
t+h
Y
t
(h) =
h1

i=0
A
i
1
e
t+hi
+ (A
i
1
B
0
)Y
t

i=1
B
i
Y
ti
3
The MSE is given by
MSE(Y
t
(h)) = E
_
_
_
h1

i=0
A
1
e
t+hi
__
h1

i=0
A
1
e
t+hi
_

_
_
+
E
_
_
A
h
B
0
_
Y
t

i=1
B
i
Y
ti
__
(A
h
B
0
)Y
t

i=1
B
i
Y
ti
_

Clearly the MSE is minimal for B


0
= A
h
1
and B
i
= 0.
4
Using
Y
t
(h) = A
h
Y
t
+
h1

i=0
A
i
e
t+hi
(3)
we get the forecast error
Y
t+h
Y
t
(h) =
h1

i=0
A
i
e
t+hi
(4)
From the forecast error it is easy to obtain the Mean Square Error, the covariance
of the forecast error,
MSE[Y
t
(h)] = E [Y
t+k
Y
t
(h)] (Y
t+k
Y
t
(h))

=

(h) =
h1

i=0
A
i

A
i
=

(h 1) + A
h1

A
h1
the MSE for will be the rst upper left n n matrix. Notice that the MSE is
non decreasing and that as h will approach the variance of Y
t
.
5
If e
t
is Gaussian WN we can easily construct condence bands for the point
forecast. Actually
Y
t+h
Y
t
(h) N(0, (h))
This implies that the forecast errors of the individual components are normal so
that
Y
k,t+h
Y
k,t
(h)
_

kk
(h)
N(0, 1)
Denoting z

the upper 100 percentage point of the normal distribution we get


1 = PR{z
/2

Y
k,t+h
Y
k,t
(h)

kk
z
/2
}
= PR{Y
k,t
(h) z
/2
_

kk
Y
k,t+h
Y
k,t
(h) + z
/2
_

kk
}
(5)
6
Hence a (1 )100% interval forecast, h periods ahead, for the kth component
of Y
t
is
[Y
k,t
(h) z
/2
_

kk
, Y
k,t
(h) + z
/2
_

kk
] (6)
In case e
t
is not Gaussian we can still construct condence bands for point forecast
using the methods described for impulse response functions.
7
What is the dierence between in-sample and out-of-sample forecasting?
How do we perform out-of-sample forecast? Suppose we have data for a sample
of length T. We proceed as follows:
1. We use the rst T
0
observation to estimate the VAR and we forecast h periods
ahead.
2. We update the sample with one observation (the length of the sample is now
T
0
+ 1) and we perform the h periods ahead forecast.
3. We repeat step 2 for all the forecasting sample period up to the last date in
the sample with one observation (the length of the sample is now T
0
+1) and
we perform the h periods ahead forecast.
8
1.1 Comparing Forecasting Performance
Out-of-sample forecast is particularly important in order to compare the fore-
casting performance of dierent model. One alternative in order to judge the
forecasting ability of a model for variable k is to compare the the mean square
forecast error for horizon h computed as
1
T T
0
T

t=T
0
(Y
kt+h
Y
kt
(h))
2
where T is the length of the out of sample forecasting period. or the root mean
square forecast error as

_
1
T T
0
T

t=T
0
(Y
kt+h
Y
kt
(h))
2
9
1.2 Application: Stock and Watson Monetary VAR
SW consider a trivariate VAR(4) model including ination unemployment and
the short term interest rate.
The sample spans from 1960:I-2000:IV. The authors use data from 1960:I to
1984:IV to estimate the VAR and then use the sample 1985:I-2000:IV to compute
the root mean square forecast error of the forecast.
In addition, the authors estimate compute the RMSE for a univariate AR(4)
forecast and a naive random walk (no change) forecast.
10
11
2 Impulse Response Functions
Impulse response functions represent the mechanisms through which shock spread
over time. Let us consider the Wold representation of a covariance stationary
VAR(p),
Y
t
= C(L)
t
=

i=0
C
i

ti
(7)
The matrix C
j
has the interpretation
Y
t

tj
= C
j
(8)
or
Y
t+j

t
= C
j
(9)
That is, the row i, column k element of C
j
identies the consequences of a unit
increase in the kth variables innovation at date t for the value of the ith variable
at time t + j holding all other innovation at all dates constant.
12
Example 1 Let us assume that the estimated matrix of VAR coecients is
A =
_
0.8 0.1
0.2 0.5
_
(10)
with eigenvalues 0.8562 and 0.4438. We generate impulse response functions of
the Wold representation
C
j
= A
j
13
Figure 3: Impulse response functions
14
Example 2 Let us now assume that the second variable does not Granger cause
the rst one so that
A =
_
0.8 0
0.2 0.5
_
(11)
with eigenvalues 0.8 and 0.5. Impulse response functions are plotted in the next
gure
15
Figure 4: Impulse response functions when the second variable does not Granger
cause the rst one.
16
2.1 Error Bands for Impulse Response Functions
To make inference about the eects of the shocks we need to quantify the uncer-
tainty around the point estimate, we need the condence bands for the impulse
response functions. We will see three dierent methods to construct condence
bands
1. Asymptotic bands
2. Montecarlo bands
3. Boostrap bands
17
2.2 Error Bands for Impulse Response Functions: Asymptotic
Hamilton (1994) shows that
_
(T)(vec(

C
s
) vec(C
s
))
L

N
_
0, G
s
(Q
1
)G

s
_
where
G
s
=
s

i=1
_
C
i1
(0
n1
C

si
C

si1
. . . C

sip+1
)

is of dimension n
2
np. Standard errors for an estimated impulse response
coecient are given by the square root of the associated diagonal element of

G
s,T
(

T
Q
1
T
)G

s,T
where

Q
T
= (1/T)
T

t=1
X
t
X

t
and X

t
= [Y

t1
, ..., Y

t1
]
.
18
2.3 Error Bands for Impulse Response Functions: Montecarlo
Montecarlo method proceeds as follows.
1. Draw
l
from N( ,


Q
1
).
2. compute C(L)
l
.
3. Repeat 1-2 M (with M big, i.e.1000) times.
4. For all the elements C
i,j,h
, i, j = 1, ..., n, h = 1, 2, ... of the impulse response
functions collect the th and 1 th percentile across the draws as a
condence interval for C
i,j,h
.
19
2.4 Error Bands for Impulse Response Functions: Bootstrap
The idea behind bootstrapping (Runkle, 1987) is to obtain estimates of the small
sample distribution for the impulse response functions without assuming that the
shocks are Gaussian. Steps:
1. Estimate the VAR and save the and the tted residuals { u
1
, u
2
, ..., u
T
}.
2. Draw uniformly from { u
1
, u
2
, ..., u
T
} and set u
(1)
1
equal to the selected real-
ization and use this to construct
Y
(1)
1
=

A
1
Y
0
+

A
2
Y
1
+ ... +

A
p
Y
p+1
+ u
(1)
1
(12)
3. Taking a second draw (with replacement) u
(2)
1
generate
Y
(2)
1
=

A
1
Y
1
+

A
2
Y
0
+ ... +

A
p
Y
p+2
+ u
(2)
1
(13)
4. Proceeding in this fashion generate a sample of length T {Y
1
1
, Y
1
2
, ..., Y
1
T
} and
use the sample to compute
(1)
and the implied impulse response functions
C
(1)
(L).
5. Repeat steps (3) (4) M times and collect M realizations of C
(l)
(L), l =
1, ...M and takes for all the elements of the impulse response functions and
20
for all the horizons the th and 1 th percentile to construct condence
bands.
21
2.5 Error Bands for Impulse Response Functions: Bootstrap after Bootstrap
The bootstrap after bootstrap method (Kilian 1998) is a way to generate bias
corrected condence bands and it works as follows.
1. Estimate the VAR using OLS.
2. Generate 1000 draws for impulse response functions using bootstrap.
3. Correct the OLS estimator for the bias and get the bias corrected estimator

=

Bias where Bias =

where

is the average of the parameter


over the bootstrap replications.
4. Use

to generate 2000 new bootstrap correcting each OLS estimate for the
previously estimated bias.
22
3 Application 3: A Monetary VAR
We estimate the standard monetary VAR which includes real output growth,
the ination rate and the federal funds rate. These three variables are the core
variables for monetary policy analysis in VAR models. Data are taken from the
St.Louis Fed FREDII database.
23
3.1 Application 3: Boostrap Bands
24
3.2 Application 3: Boostrap After Bootstrap Bands
25
4 Cumulated impulse response functons
Suppose Y
t
is a vector of trending variables (i.e. log prices and output) so we
consider the rst dierence to reach stationarity. So the model is
Y
t
= (1 L)Y
t
= C(L)
t
We know hoe to estimate, interpret, and conduct inference on C(L). But suppose
we are interested in the response of the levels of Y
t
rather than their rst dierences
(the level of and prices rather than their growth rates). How can we nd these
responses? We transform the model
Y
t
= Y
t1
+ C(L)
t
The eect of
t
on Y
t
is C
0
. Now substituting forward we obtain
Y
t+1
= Y
t1
+ C(L)
t
+ C(L)
t+1
= Y
t1
+ C
0

t+1
+ (C
0
+ C
1
)
t
+ ...
(14)
and for two periods ahead
Y
t+2
= Y
t1
+ C(L)
t
+ C(L)
t+1
+ C(L)
t+2
26
= Y
t1
+ C
0

t+2
+ (C
0
+ C
1
)
t+1
+ (C
0
+ C
1
+ C
2
)
t+1
...
(15)
so the eect of
t
on Y
t+1
are (C
0
+C
1
) and on Y
t+2
is (C
0
+C
1
+C
2
). In general
the eects of
t
on Y
t+j
are

C
j
= C
0
+ C
1
+ ... + C
j
dened as cumulated impulse response functions.
27

You might also like