Sunteți pe pagina 1din 37

Vector

Autoregression in
Eview

Kelikume Ikechukwu
ikelikume@lbs.edu.ng
CONTENT
 Introduction
 Vector Autoregressive Models:
Notation and Concepts
 Choosing the Optimal Lag Length for a
VAR
 Information Criteria for VAR Lag Length
Selection
 Does the VAR Include Contemporaneous
Terms?
 Primitive versus Standard Form VARs
 Block Significance and Causality Tests
Content
 Testing for Granger causality
 Interpreting Granger Causality Tests
 Impulse Responses
 Variance Decompositions
 Impulse Responses and Variance
Decompositions: The Ordering of the Variables
i. Estimating a VAR in E-view
ii. VAR Estimation Output
iii.Working with a VAR
iv.Granger Causality Tests
Introduction
 Since the seminal work by Sims (1980)*,
structural-VAR and cointegrated VAR’s have
been applied to economic data to;
ii. Forecast macro time series
iii. Study the sources of economic fluctuations
iv. Test economic theories
 VAR resembles a simultaneous equation
modeling
 In VAR, we consider several endogenous
variables together. Each endogenous
variables is explained by its lagged values
and the lagged values of all other
endogenous variables in the model.
Introduction
• In the SEM model, some variables are treated as
endogenous and some are predetermined.
• In estimating SEM, we have to make sure that the
equation in the system are identified – this is achieved
by assuming that some of the predetermined variables
are present only in some equation (which is very
subjective) – and criticized by Christopher Sims (1980)
• If there is simultaneity among set of variables, they
should all be treated on equal footing, i.e., there should
not be any a priori distinction between endogenous and
exogenous variables.

 *Sims, C. A. (1980). “Macroeconomics and Reality”


Econometrica, 48 (10), pp.1-48.
Vector Autoregressive
Models
• A natural generalisation of autoregressive
models popularised by Sims (1980), is a
framework, that has more than one dependent
variable.
• The
y = βsimplest
+ β y case
+ ...+ β isya bivariate
+ α y +VAR
...+ α y + u
1t 10 11 1t − 1 1k 1t − k 11 2 t − 1 1k 2 t − k 1t
y2 t = β 20 + β 21 y2 t − 1 + ...+ β 2 k y2 t − k + α 21 y1t − 1 + ...+ α 2 k y1t − k + u2 t

where uit is an iid disturbance with E(uit)=0,


i=1,2; E(u1t u2t)=0. 
• The analysis could be extended to a VAR(p)
model, or so that there are p variables and p
equations.
Vector Autoregressive
Models:
Notation and Concepts
• One important feature of VARs is the
compactness with which we can write the
notation. For example, consider the case from
above where k=1. 
Wey can write this
β asα

β
 1t   10   11 y 11   1t − 1 
u  1t 
  =  +   + 
 y2 t   β20   α21 β21   y2 t −1   u2 t 

• or even more compactly as


yt = β0 + β1 yt-1 + ut
px1 px1 pxp px1 px1
Models:
Notation and Concepts
(cont’d)

• This model can be extended to the case


where there are k lags of each variable in
each equation:
yt= β0 + β1 yt-1 + β2 yt-2 +...+ βk yt-k + ut
p×1 p×p p×1 p×p p×1 p×p p×1 p×
1
We can also extend this to the case where
the model includes first difference terms
and
co integrating relationships (a VECM).
Choosing the Optimal Lag
Length for a VAR
● In modelling unrestricted VAR, each
equation should have the same lag
length
● Suppose that a bivariate VAR(8)
estimated using quarterly data has 8
lags of the two variables in each
equation, and we want to examine a
restriction that the coefficients on lags 5
through 8 are jointly zero. This can be
done using a likelihood ratio test.
Choosing the Optimal Lag
Length for a VAR (cont’d)
● Denote the variance-covariance matrix of residuals
uˆuˆ′ by
(given /T), asΣ . The likelihood ratio test
● for this joint hypothesis is given by [ ]
LR = T log Σˆ r − log Σˆ u

Σ̂ r : variance-covariance matrix of the residuals for the


restricted model (with 4 lags),
Σ̂ u : variance-covariance matrix of residuals for the
unrestricted VAR (with 8 lags), and T is the sample size.
 The test statistic is asymptotically distributed as a χ2
with degrees of freedom equal to the total number of
restrictions. In the VAR case above, we are restricting 4
lags of two variables in each of the two equations = a
total of 4 *2 * 2 = 16 restrictions.
Choosing the Optimal Lag
Length for a VAR (cont’d)
 In the general case where we have a
VAR with p equations, and we want to
impose the restriction that the last q
lags have zero coefficients, there would
be p2q restrictions altogether
 Disadvantages: Conducting the LR test
is cumbersome and requires a normality
assumption for the disturbances.
Information Criteria for VAR
Lag Length Selection
 Multivariate versions of the information criteria
are required. These can be defined as:
MAIC=ln Σ ˆ + 2k ′/ T
ˆ + k′
MSBIC = ln Σ ln(T)
T
ˆ + 2k ′
MHQIC= ln Σ ln(ln(T))
T
where all notation is as above and k′ is the total
number of regressors in all equations, which will
be equal to p2k + p for p equations, each with k
lags of the p variables, plus a constant term in
each equation. The values of the information
criteria are constructed
k for 0, 1, … lags (up to
some pre-specified maximum ).
Does the VAR Include
Contemporaneous Terms?
 So far, we have assumed the VAR is of the
form y1t = β10 + β11 y1t −1 + α11 y2 t −1 + u1t
  y2 t = β20 + β21 y2 t −1 + α21 y1t −1 + u2 t

 But what if the equations had a


y1t = β10 + β11 y1t −1 + α11 y2 t −1 + α12 y2 t + u1t
contemporaneous feedback term?
y2 t = β20 + β21 y2 t −1 + α 21 y1t −1 + α 22 y1t + u2 t
 

 We
 y1can
t  βwrite
10   βthis as
11 α11   y1t −1   α12 0   y2 t   u1t 
  =  +   +   +  
 y2 t   β20   α 21 β21   y2 t −1  0 α 22   y1t   u2 t 

This VAR is in primitive form.


Does the VAR Include
Contemporaneous Terms?
 So far, we have assumed the VAR is of the
form y1t = β10 + β11 y1t −1 + α11 y2 t −1 + u1t
  y2 t = β20 + β21 y2 t −1 + α21 y1t −1 + u2 t

 But what if the equations had a


y1t = β10 + β11 y1t −1 + α11 y2 t −1 + α12 y2 t + u1t
contemporaneous feedback term?
y2 t = β20 + β21 y2 t −1 + α 21 y1t −1 + α 22 y1t + u2 t
 

 We
 y1can
t  βwrite
10   βthis as
11 α11   y1t −1   α12 0   y2 t   u1t 
  =  +   +   +  
 y2 t   β20   α 21 β21   y2 t −1  0 α 22   y1t   u2 t 

This VAR is in primitive form.


Block Significance and
Causality Tests
 It is likely that, when a VAR includes many lags
of variables, it will be difficult to see which sets of
variables have significant effects on each
dependent variable and which do not. For
illustration,
α β consider
β y theγ following
γ y bivariate
δ δ VAR(3):
 1t   10   11 12   1t − 1   11 12   1t − 2   11 12   1t − 3   1t 
y y u
  =   +     +     +     +  
 y 2t   α 20   β 21 β 22   y 2t − 1   γ 21 γ 22   y 2t − 2   δ 21 δ 22   y 2t − 3   u 2t 
This VAR could be written out to express the
= α 10 + β 11 y1t −equations
1 + β 12 y2t − 1 + γ as
11 y1t − 2 + γ 12 y2t − 2 + δ 11 y1t − 3 + δ 12 y2t − 3 + u1t

y1tindividual
y2t = α 20 + β 21 y1t − 1 + β 22 y2t − 1 + γ 21 y1t − 2 + γ 22 y2t − 2 + δ 21 y1t − 3 + δ 22 y2t − 3 + u2t
Block Significance and
Causality Tests (cont’d)
 We might be interested in testing the following
hypotheses, and their implied restrictions on the
parameter matrices:
Hypothesis Implied Restriction
1. Lags of y1t do not explain current y2t β
21 = 0 and γ
21 = 0 and δ21 = 0
2. Lags of y1t do not explain current y1t β
11 = 0 and γ
11 = 0 and δ11 = 0
3. Lags of y2t do not explain current y1t β
12 = 0 and γ
12 = 0 and δ12 = 0
4. Lags of y2t do not explain current y2t β
22 = 0 and γ
22 = 0 and δ22 = 0

 Each of these four joint hypotheses can be tested


within the F-test framework, since each set of
restrictions contains only parameters drawn from
one equation.
 These tests could also be referred to as Granger
causality tests.
Block Significance and
Causality Tests (cont’d)
 Granger causality tests seek to answer
questions such as “Do changes in y1
cause changes in y2?” If y1 causes y2,
lags of y1 should be significant in the
equation for y2. If this is the case, we
say that y1 “Granger-causes” y2.
 If y2 causes y1, lags of y2 should be
significant in the equation for y1.
 If both sets of lags are significant, there
is “bi-directional causality”
Testing for Granger causality
 A bivariate VAR:
 xt   c1   11 ( L ) 12 ( L )   xt 1   1t 
 y    c     ( L)  ( L)   y     
 t  2  21 22   t 1   2t 
Granger-causality means that:
x Granger-causes y if  21 ( L)  0
y Granger-causes x if 12 ( L)  0
Or, Granger-causality means that:

 xt   1   11 ( L) 12 ( L)   1t 


 y         ( L)
 t  2  21  22 ( L)    2t 
x Granger-causes y if 12 ( L)  0
y Granger-causes x if  21 ( L)  0
Testing for Granger
causality
• Approach 1: Test the null hypothesis H 0 : 1  ...   p in the
regression:
xt  c   ( L) xt 1  1 yt 1  ...   p yt  p   t
rejection of the null is taken as evidence that y Granger-causes

x. One can use an F-test (Wald test) – it has better small


sample properties. Alternatively, one could use a likelihood
ratio test, which is χ2 distributed.
Testing for Granger
causality
• Approach 2: Use a regression by truncating the
infinite lagged polynomials and making sure the residuals
are uncorrelated; alternatively, produce corrected
(heteroskedasticity and autocorrelation consistent) standard
errors. One way to do it with the auxiliary regression,
p k k
yt  c   h j yt  j   b j xt  j   d j xt  j  vt
j 1 j 0 j 1
Choose p such that vt are white noise – k is arbitrarily chosen.
Test the null hypothesis H 0 : d1  ...  d k  0 .
Rejection of this null is taken as evidence that y Granger-
causes x (no, there is no typo here!)
Testing for Granger
causality
 Approach 1: Test the null hypothesis
in the
 regression:

 rejection of the null is taken as


evidence that y Granger-causes
x. One can use an F-test (Wald test)
– it has better small
sample properties. Alternatively, one
could use a likelihood
ratio test, which is χ2 distributed.
Interpreting Granger
Causality Tests
 References: Hamilton, pp. 306-309.
 y Granger-causes x does not mean that
there is an economic generating
mechanism such that future values of x
are caused by y. Granger-causality is a
statement about the predictive ability of
y in forecasting x.
 Omitted variables (such as examining
bivariate Granger-causality in an n-
dimensional VAR) can lead to detecting
spurious causal relations.
Impulse Responses
• VAR models are often difficult to interpret: one
solution is to construct the impulse responses and
variance decompositions.
• Impulse responses trace out the responsiveness of
the dependent variables in the VAR to shocks to the
error term. A unit shock is applied to each variable
and its effects are noted.
y1t = β10 + β11 y1t −1 + α11 y2 t −1 + u1t
• Consider for example a simple bivariate VAR(1):
y2 t = β20 + β21 y2 t −1 + α21 y1t −1 + u2 t

• A change in u1t will immediately change y1. It will


change y2 and also y1 during the next period.
• We can examine how long and to what degree a
shock to a given equation has on all of the variables
in the system.
Impulse Responses and Variance
Decompositions: The Ordering of
the Variables
• But for calculating impulse responses and
variance decompositions, the ordering of the
variables is important.
• The main reason for this is that above, we
assumed that the VAR error terms were
statistically independent of one another.
• This is generally not true, however. The error
terms will typically be correlated to some
degree.
• Therefore, the notion of examining the effect
of the innovations separately has little
meaning, since they have a common
Impulse Responses and Variance
Decompositions: The Ordering of
the Variables
• What is done is to “orthogonalize” the
innovations.
• In the bivariate VAR, this problem would
be approached by attributing all of the
effect of the common component to the
first of the two variables in the VAR.
• In the general case where there are
more variables, the situation is more
complex but the interpretation is the
same.
Vector Autoregression Theory
(VAR) Estimating a VAR in E-
view

i. File/new/workfile
ii. File/import/Read Excel/…..IP
iii.Quick/Estimate VAR
iv. Lag intervals: 1 2 tells E-views to
use the first and second lags of all
of the variables in the system as
right-hand side variables.
Theory (VAR)
Estimating a VAR in E-
view
 Select Menu Options;
File/Open/Workfile
 Define the variables
 File/New/Program
 series inms=log(ms)
 series lnRGDP=log(RGDP)
 series dinrdgp=lnrgdp-lnrgdp(-1)
 series dlnms=lnms-lnms(-1)
Test the Stationarity
property
 Stationarity test is done to decide
on VAR model in level or first
difference.
 Some econometricians have
argued that the debate on
stationary, nonststionary variables
is mostly irrelevant for VAR
modeling and that one is allowed
to use a level VAR.
VAR ESTIMATION
 Select the series you wish to
analyze
 dlnms, dlnrgdp
 Press CTRL and left click the
variable with your mouse
 Select Group window Procs/Make
Vector Autoregression
 Select Unrestricted VAR, sample
1960 2008 the estimation will
Lag Length selection
Criteria
 Select VAR window View/Lag
length criteria Max lags 12
 You will find the model selection
criteria log- likelihood, LR, FPE,
AIC, SIC, HQ
 Decide the optimal number of lag
 By using the AIC and SIC criteria
with the least value from our
result it seems that the lag length
Impulse Response
Function
 A shock to the i-th variable not
only directly affects the i-th
variable but is also transmitted to
all of the other endogenous
variable through the dynamic (lag)
structure of the VAR.
 An impulse response function
traces the effect of a one standard
deviation shock to one of the
innovations on current and future
values of the endogenous
variables.
Impulse Response
Function
 If the innovations εt are
contemporaneously uncorrelated,
interpretation of the impulse
response is straightforward.
 The i-th innovation ε
i,t is simply a
shock to the i-th endogenous
variable yi,t.
Impulse Response Function in VAR
 Select VAR window Impulse or

(View/impulse response)
Impulse Response
Function
 Under Impulse Definition select
Multiple Graphs, Response
Standard Errors – Monte Carlos,
and Period 10 or more periods
For stationary VARs, the impulse
responses should die out to zero and the
accumulated responses should asymptote
to some (non-zero) constant.
Vector Autoregression Theory
(VAR)
3. Working with a VAR
A. Variance Decomposition:
 While impulse response functions trace the effects of a shock
to one endogenous variable on to the other variables in the
VAR, variance decomposition decomposes variation in an
endogenous variable into the component shocks to the
endogenous variables in the VAR. To obtain the variance
decomposition, we can select following:
1) View/Variance decomposition
2) Option: Table, Multiple graphs, Combined response graphs.
 The source of this forecast error is the variation in the current
and future values of the innovations to each endogenous
variable in the VAR. The percentage of the forecast variance
due to each innovation, with each row adds up to 100.
Vector Autoregression Theory
(VAR)
Granger Causality Tests
 We can test Granger causality by running a VAR
on the system of equations and testing for zero
restrictions on the VAR coefficients.
 The Granger (1969) approach to the question of
whether x causes y is to see how much of the
current y can be explained by past values of y
and to see whether adding lagged values of x
can improve the explanation.
 The y is said to be Granger-caused by x if x
helps in the prediction of y, or equivalently if
the coefficients on the lagged x’s are
statistically significant. Note that the two-way
Vector Autoregression Theory
(VAR)
Granger Causality Tests
 E-view Example:
1) Quick/Group Statistics/Granger Causality
2) List of series: ms GDP
3) Lag: 2 (You may choose other lags)
 The hypothesis that past Ms does not affect future
GDP is not rejected.
 The hypothesis that past GDP does not affect future Ms
is
not rejected.
 If you want to run Granger causality tests with other
exogenous variables (e.g. seasonal dummy variables or
linear trends) or if you want to carry out likelihood ratio
(LR) tests, run the test regressions directly using equation
objects.

S-ar putea să vă placă și