Upload
gbengaode
View
5.678
Download
1
Embed Size (px)
Citation preview
Vector Autoregression in Eview
Kelikume [email protected]
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-viewii. VAR Estimation Outputiii.Working with a VARiv.Granger Causality Tests
Introduction Since the seminal work by Sims (1980)*,
structural-VAR and cointegrated VAR’s have been applied to economic data to;
i. Forecast macro time seriesii. Study the sources of economic fluctuationsiii. 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 simplest case is a bivariate VAR
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.
y y y y y u
y y y y y ut t k t k t k t k t
t t k t k t k t k t
1 10 11 1 1 1 1 11 2 1 1 2 1
2 20 21 2 1 2 2 21 1 1 2 1 2
... ...
... ...
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.
• We can write this as
• or even more compactly as
yt = 0 + 1 yt-1 + ut
px1 px1 pxp px1 px1
y
y
y
y
u
ut
t
t
t
t
t
1
2
10
20
11 11
21 21
1 1
2 1
1
2
Vector Autoregressive 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
p1 pp p1 pp p1 pp p1 p1
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
(given by /T), asΣ . The likelihood ratio test for this joint hypothesis is given by : variance-covariance matrix of the residuals for the
restricted model (with 4 lags), : 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.
uu ˆˆ urTLR ˆlogˆlog
r
u
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:
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 for 0, 1, … lags (up to some pre-specified maximum ).k
ln(ln(T))2ˆln
ln(T)ˆln
/2ˆln
T
kMHQIC
T
kMSBIC
TkMAIC
Does the VAR Include Contemporaneous Terms?
So far, we have assumed the VAR is of the form
But what if the equations had a contemporaneous feedback term?
We can write this as
This VAR is in primitive form.
y y y u
y y y ut t t t
t t t t
1 10 11 1 1 11 2 1 1
2 20 21 2 1 21 1 1 2
y y y y u
y y y y ut t t t t
t t t t t
1 10 11 1 1 11 2 1 12 2 1
2 20 21 2 1 21 1 1 22 1 2
y
y
y
y
y
y
u
ut
t
t
t
t
t
t
t
1
2
10
20
11 11
21 21
1 1
2 1
12
22
2
1
1
20
0
Does the VAR Include Contemporaneous Terms?
So far, we have assumed the VAR is of the form
But what if the equations had a contemporaneous feedback term?
We can write this as
This VAR is in primitive form.
y y y u
y y y ut t t t
t t t t
1 10 11 1 1 11 2 1 1
2 20 21 2 1 21 1 1 2
y y y y u
y y y y ut t t t t
t t t t t
1 10 11 1 1 11 2 1 12 2 1
2 20 21 2 1 21 1 1 22 1 2
y
y
y
y
y
y
u
ut
t
t
t
t
t
t
t
1
2
10
20
11 11
21 21
1 1
2 1
12
22
2
1
1
20
0
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 the following bivariate VAR(3):
This VAR could be written out to express the individual equations as
t
t
t
t
t
t
t
t
t
t
u
u
y
y
y
y
y
y
y
y
2
1
32
31
2221
1211
22
21
2221
1211
12
11
2221
1211
20
10
2
1
tttttttt
tttttttt
uyyyyyyy
uyyyyyyy
2322231212222212112221121202
1321231112212211112121111101
Block Significance and Causality Tests (cont’d)
We might be interested in testing the following hypotheses, and their implied restrictions on the parameter matrices:
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.
Hypothesis Implied Restriction1. 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
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”
A bivariate VAR:
Granger-causality means that: x Granger-causes y if y Granger-causes x if
Or, Granger-causality means that:
x Granger-causes y if y Granger-causes x if
Testing for Granger causality
1 11 11 12
1 22 21 22
( ) ( )
( ) ( )t t t
t t t
x xc L L
y yc L L
21( ) 0L 12 ( ) 0L
12 ( ) 0L 21( ) 0L
11 11 12
22 21 22
( ) ( )
( ) ( )t t
t t
x L L
y L L
• 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.
Testing for Granger causality
1 1 1( ) ...t t t p t p tx c L x y y
0 1: ... pH
• 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,
Choose p such that vt are white noise – k is arbitrarily chosen. Test the null hypothesis . Rejection of this null is taken as evidence that y Granger- causes x (no, there is no typo here!)
Testing for Granger causality
1 0 1
p k k
t j t j j t j j t j tj j j
y c h y b x d x v
0 1: ... 0kH d d
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.
• Consider for example a simple bivariate VAR(1):
• 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.
y y y u
y y y ut t t t
t t t t
1 10 11 1 1 11 2 1 1
2 20 21 2 1 21 1 1 2
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 component.
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/workfileii. File/import/Read Excel/…..IPiii.Quick/Estimate VARiv.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.
Vector Autoregression 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 automatically adjust the sample period for missing observations
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 is 1
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
B. 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 decomposition2) 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 causation is frequently the cases; x Granger causes y and y Granger causes x.
Vector Autoregression Theory (VAR) Granger Causality Tests
E-view Example:1)Quick/Group Statistics/Granger Causality2)List of series: ms GDP3)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.