C:\NrPortbl\CCBS_DOCS\145607\3855_1.DOC

EXERCISE ON ESTIMATING A STRUCTURAL VAR IN EVIEWS

Introduction

The aim of this exercise is to describe the basic steps to estimate a structural VAR and studying impulse response curves in EViews.

We use Australian data for our examples in this exercise. The dataset is quarterly data spanning 21 years: 1980Q1 - 2001Q1

Preparations

Enter EViews and choose:

  • File
  • Open dataset
  • And select Svardata.wf1 and click OK

1Defining the model

We define a simple model of an economy (in this case Australia) for the estimate of the VAR, with four endogenous variables[1]: Inflation (INF), Real exchange rate (REER), Interest rate (INTEREST), and Output gap (GAP).

Q1. Before we estimate our model, what should we do to ensure that our estimates are not biased?

Answer: We use OLS to estimate the VARS so we need to ensure that all variables are stationary to avoid the spurious regression problem associated with unit roots.

Check for stationarity or otherwise of the four variables (see Unit Root exercise). We assume that all four variables are stationary I(0) variables for simplicity.

Q2. Estimate an unrestricted VAR with all four endogenous variables in their stationary form with a constant.

Answer:Use Quick, Estimate VAR ortype in the command window:

var var01.ls 1 5 INTEREST GAP INF REER,

this command specifies a VAR estimate with the name var01 of the four variables (interest in difference note) and a lag length of 5.

Vector Autoregression Estimates
Date: 11/19/02 Time: 12:45
Sample(adjusted): 1981:2 2001:4
Included observations: 83 after adjusting endpoints
Standard errors in ( ) & t-statistics in [ ]
INTEREST / GAP / INF / REER
INTEREST(-1) / 0.983846 / 0.001558 / 0.209413 / 0.622813
(0.12698) / (0.00086) / (0.09527) / (0.40982)
[ 7.74811] / [ 1.81260] / [ 2.19814] / [ 1.51972]
.
.
.
C / -0.325614 / 0.013497 / 1.355519 / 12.57886
(1.57990) / (0.01069) / (1.18535) / (5.09909)
[-0.20610] / [ 1.26221] / [ 1.14356] / [ 2.46688]
R-squared / 0.950040 / 0.809195 / 0.958091 / 0.959035
Adj. R-squared / 0.933923 / 0.747645 / 0.944572 / 0.945821
Sum sq. resids / 73.04422 / 0.003346 / 41.11679 / 760.8750
S.E. equation / 1.085418 / 0.007346 / 0.814355 / 3.503167
F-statistic / 58.94917 / 13.14695 / 70.86924 / 72.57452
Log likelihood / -112.4692 / 302.1585 / -88.62130 / -209.7205
Akaike AIC / 3.216126 / -6.774905 / 2.641477 / 5.559530
SchwarzSC / 3.828121 / -6.162909 / 3.253473 / 6.171525
Mean dependent / 9.580241 / -0.000263 / 5.088072 / 111.2133
S.D. dependent / 4.222534 / 0.014624 / 3.458975 / 15.05025
Determinant Residual Covariance / 0.000461
Log Likelihood (d.f. adjusted) / -152.2836
Akaike Information Criteria / 5.693581
Schwarz Criteria / 8.141564

Q3. We've selected a lag length of 5 for this estimate but is that appropriate?

Answer: Adding more lags always improves the fit but it reduces the degrees of freedom and increases the danger of overfitting. An objective and replicable way to decide between these competing objectives is to maximise some weighted measures of these two parameters. This is how the Akaike Information criterion (AIC) and the Schwarz-Bayesian criterion (SBC) work. These two statistics are measures of the trade-off fit against loss of degrees of freedom so that the best lag length should minimise[2] both of them.

An alternative to minimising a weighted measure of the lag length and best fit, as above, is to systematically test for the significance of each lag using a likelihood ratio test (discussed in Lutkepohl, 1991, section 4.3). Since a VAR of lag length n nests the same VAR of lag length (n-1), the log likelihood difference multiplied by the number of observations less the number of regressors in the VAR should be distributed as a Chi-sq distribution with 2k degree of freedom, 2(2k) i.e.

LR = (T-m) {logn-1- logn} ~ 2(2k)

Where T is the number of observations, m is the number of regressors , logn is the log likelihood of the VAR with n lags. The idea is that for each lag length, if there is no improvement in the fit from the inclusion of this last lag then the difference in errors should not be significantly different from white noise.

For our example, we use a general-to-specific specification (although some authors might specify a specific-to-general instead).

(i)We start with a large lag length (say 10).

(ii)For each lag, say n, note its log likelihood then calculate the log likelihood for a VAR of lag (n-1)

(iii)Take the difference of the log likelihoods

(iv)This difference in (iii) should be distributed as a Chi-sq distribution with eight degrees of freedom 2(8) if it is superfluous.

Q4. Test for the number of lags using the AIC, SC, and the likelihood ratio test for the appropriate lag length in the VAR

Answer: with the VAR open select VIEW/ LAG STRUCTURE/ LAG LENGTH CRITERIAthen enter 10 in the maximum lag specification.

The readout should be:

VAR Lag Order Selection Criteria
Endogenous variables: INTEREST GAP INF REER
Exogenous variables: C
Date: 11/19/02 Time: 12:34
Sample: 1980:1 2001:4
Included observations: 78
Lag / LogL / LR / FPE / AIC / SC / HQ
0 / -459.7154 / NA / 1.713665 / 11.89014 / 12.01099 / 11.93852
1 / -169.8935 / 542.4870 / 0.001531 / 4.869064 / 5.473349* / 5.110970*
2 / -152.9814 / 29.92147 / 0.001501 / 4.845676 / 5.933388 / 5.281107
3 / -137.4222 / 25.93198 / 0.001531 / 4.856979 / 6.428118 / 5.485935
4 / -125.4949 / 18.65545 / 0.001726 / 4.961408 / 7.015975 / 5.783889
5 / -95.16905 / 44.32243* / 0.001227* / 4.594078 / 7.132072 / 5.610084
6 / -80.29215 / 20.21733 / 0.001314 / 4.622876 / 7.644297 / 5.832406
7 / -60.13943 / 25.32009 / 0.001249 / 4.516396* / 8.021245 / 5.919451
8 / -51.09151 / 10.43991 / 0.001612 / 4.694654 / 8.682931 / 6.291234
9 / -30.89014 / 21.23733 / 0.001606 / 4.586927 / 9.058631 / 6.377032
10 / -19.16174 / 11.12694 / 0.002055 / 4.696455 / 9.651586 / 6.680085
* indicates lag order selected by the criterion
LR: sequential modified LR test statistic (each test at 5% level)
FPE: Final prediction error
AIC: Akaike information criterion
SC: Schwarz information criterion
HQ: Hannan-Quinn information criterion

The correct lag length will depend on the criteria or measure we use. This is typical of these tests and researchers often use the criterion most convenient for their needs. The SC criterion is generally more conservative in terms of lag length than the AIC criterion.

Here we assume a lag length of 1 for convenience.

2VAR identification

We have an underlying structural equation of the form:

(1)

where the stochastic error ut is normally distributed i.e. ut N(0,I). Unfortunately we cannot estimate this equation directly due to identification issues, but instead we have estimated an unrestricted VAR of the form:

(2)

Matrices A B and C are not separately observable. So how can we recover equation (1) from (2)? The solution is to impose restrictions on our VAR to identify an underlying structure but kind of restrictions are these?

Economic theory can sometime tell us something about the structure of the system we wish to estimate. As economists, we must interpret these structure or assumption from theory into restrictions on the VAR. Such restrictions can include for example:

  1. Causal ordering of shock propagation e.g. Cholesky decomposition
  2. Nominal variables to have no long run effect on real variables
  3. Long run behaviour of variables e.g. real exchange rate is constant in the long run

There are two types of restrictions, one type imposes restrictions on the short-run behaviour of the system, and the other type imposes restrictions on the long run behaviour of the system. EViews allows either short run or long run identifying restrictions, but not both types in one VAR. Moreover, it also assumes that matrix B is an invertable square matrix i.e. there are no identities in the system.

3Imposing Short Run Restrictions

To impose short run restrictions in EViews we use equation (2):

We can estimate the random stochastic residual A-1But from the residual et of the estimated unrestricted VAR:

(3)

Reformulating equation (3) we have , and since , we have:

(4)

Equation (4) says that if there are k variables, the symmetry property above imposes k(k+1)/2 restrictions on the 2k2 unknown elements in A and B. Hence an additional k(3k-1)/2 restrictions must be imposed. EViews requires that such restriction schemes must be of the form:

(5)

By imposing a structure on matrices A and B, we necessarily impose restrictions on the structural VAR in equation (1). An example of this specification using the Cholesky decomposition identification scheme is:

A = , B =

For our example, we have a VAR with four endogenous variables, therefore we require 22 = 4(3*4-1)/2 restrictions. We can impose this restriction in EViews in either matrix form or in text form. Imposing restrictions in matrix form is relatively straightforward, so we explain the text form instead.[3]

Q5. Impose the Cholesky decomposition. Assumes that shocks or innovations are propagated in the order of INTEREST, GAP, INF and then REER,

Answer: To impose the restriction above in text format, we select Procs/Estimate Structural Factorizationfrom the VAR window menu. In the SVAR Options dialog, select Text (or Matrix is appropriate).

Each endogenous variable has an associated variable number, in our example this is:

@e1 for INTEREST residuals

@e2 for GAP residuals

@e3 for INF residuals

@e4 for REER residuals

The identifying restriction is imposed in terms of variables e's which are the residuals from the VAR estimates, and variables u's which are the fundamental or 'primitive' random (stochastic) errors in the structural system.

Enter the following the text box:

@e1 = C(1)*@u1

@e2 = C(2)*@e1 + C(3)*@u2

@e3 = C(4)*@e1 + C(5)*@e2 + C(6)*@u3

@e4 = C(7)*@e1 + C(8)*@e2 + C(9)*@e3 + C(10)*@u4

To use the matrix form to impose a restriction, create two matrices with the following values (we call them A and B here)

A =, B =

Select the matrix specification in the structural factorisation described above and enter the names of the matrices (A and B) as appropriate:

The output is:

Structural VAR Estimates
Sample(adjusted): 1981:2 2001:4
Included observations: 83 after adjusting endpoints
Estimation method: method of scoring (analytic derivatives)
Convergence achieved after 12 iterations
Structural VAR is just-identified
Model: Ae = Bu where E[ee']=I
Restriction Type: short-run pattern matrix
A =
1 / 0 / 0 / 0
C(1) / 1 / 0 / 0
C(2) / C(4) / 1 / 0
C(3) / C(5) / C(6) / 1
B =
C(7) / 0 / 0 / 0
0 / C(8) / 0 / 0
0 / 0 / C(9) / 0
0 / 0 / 0 / C(10)
Coefficient / Std. Error / z-Statistic / Prob.
C(1) / -0.001066 / 0.000734 / -1.453529 / 0.1461
C(2) / -0.091071 / 0.082789 / -1.100032 / 0.2713
C(3) / 0.329808 / 0.347913 / 0.947961 / 0.3431
C(4) / 1.055599 / 12.23200 / 0.086298 / 0.9312
C(5) / -48.42839 / 51.03540 / -0.948918 / 0.3427
C(6) / 0.965941 / 0.457947 / 2.109284 / 0.0349
C(7) / 1.085418 / 0.084245 / 12.88410 / 0.0000
C(8) / 0.007255 / 0.000563 / 12.88410 / 0.0000
C(9) / 0.808446 / 0.062748 / 12.88410 / 0.0000
C(10) / 3.372914 / 0.261789 / 12.88410 / 0.0000
Log likelihood / -152.2836
Estimated A matrix:
1.000000 / 0.000000 / 0.000000 / 0.000000
-0.001066 / 1.000000 / 0.000000 / 0.000000
-0.091071 / 1.055599 / 1.000000 / 0.000000
0.329808 / -48.42839 / 0.965941 / 1.000000
Estimated B matrix:
1.085418 / 0.000000 / 0.000000 / 0.000000
0.000000 / 0.007255 / 0.000000 / 0.000000
0.000000 / 0.000000 / 0.808446 / 0.000000
0.000000 / 0.000000 / 0.000000 / 3.372914

4Imposing Long Run Restrictions

To impose long run restrictions, we return to the unrestricted VAR estimate:

Rearrangement of this equation reveals equation (5) below:

(6)

Equation (6) shows how the random (stochastic) shocks affect the long-run levels of the variables. If we define a matrix , the aggregate effect of a shock u's is given by matrix C. Hence if we assume that the (long run) cumulative effect of a sub-shock ui on a variable yj is zero, then column i and row j of matrix C should be zero. Knowing the values of matrix C tells us something about matrices A and B.

Due to the number of restrictions required EViews also imposes the restriction that matrix A is the identity matrix. It uses matrix C to estimate matrix B.

Long run imposition can be specified in matrix form (were matrix C is entered) or in text form in EViews.

Going back to our example, we know that we must have at least 22 restrictions. Matrix A is assumed to be the identity matrix. This is equivalent to 16 restrictions so a further 6 restrictions must be imposed in matrix C.

We have the following variable numeration:

Q6. Impose the following (arbitrary) restriction to matrix C:

(i)The two nominal variable (INTERST and INF) have no long run real effect, and

(ii)INF shocks have no long run effect on other variables

(iii)Gap is unaffected by any shocks but its own

Answer: In matrix form this is:

C =

In the text form restriction is:

@LR1(@U3)=0

@LR2(@U1)=0

@LR2(@U3)=0

@LR2(@U4)=0

@LR4(@U1)=0

@LR4(@U3)=0

The output is:

Structural VAR Estimates
Sample(adjusted): 1980:2 2001:4
Included observations: 87 after adjusting endpoints
Estimation method: method of scoring (analytic derivatives)
Convergence achieved after 13 iterations
Structural VAR is just-identified
Model: Ae = Bu where E[ee']=I
Restriction Type: long-run text form
Long-run response pattern:
C(1) / C(3) / 0 / C(8)
0 / C(4) / 0 / 0
C(2) / C(5) / C(7) / C(9)
0 / C(6) / 0 / C(10)
Coefficient / Std. Error / z-Statistic / Prob.
C(1) / 10.96752 / 0.831445 / 13.19091 / 0.0000
C(2) / 8.536423 / 0.851401 / 10.02632 / 0.0000
C(3) / -13.50216 / 2.386708 / -5.657231 / 0.0000
C(4) / -0.031006 / 0.002351 / -13.19091 / 0.0000
C(5) / -7.593409 / 1.964504 / -3.865306 / 0.0001
C(6) / -27.08645 / 7.892281 / -3.432018 / 0.0006
C(7) / 5.160389 / 0.391208 / 13.19091 / 0.0000
C(8) / 16.85658 / 1.736553 / 9.706919 / 0.0000
C(9) / 14.40233 / 1.528329 / 9.423579 / 0.0000
C(10) / 71.07902 / 5.388486 / 13.19091 / 0.0000
Log likelihood / -200.6625
Estimated A matrix:
1.000000 / 0.000000 / 0.000000 / 0.000000
0.000000 / 1.000000 / 0.000000 / 0.000000
0.000000 / 0.000000 / 1.000000 / 0.000000
0.000000 / 0.000000 / 0.000000 / 1.000000
Estimated B matrix:
1.101966 / -0.022506 / -0.298165 / 0.025184
0.002579 / 0.007326 / 0.000116 / 0.002695
0.281968 / -0.430771 / 0.470101 / 0.700787
-1.833790 / 0.327101 / -3.389196 / 1.608676

5Generating impulse responses

Q7. Generate impulse response curves for the identification scheme in our example.

Answer: Selecting VIEW/IMPULSE RESPONSES, on the IMPULSE DEFINITIONtag select STRUCTURAL DECOMPOSITION. This option shows the impulse response of each variable from shocks to the underlying fundamental shocks (u's).

Can you go back and replicate this for the Cholesky decomposition? How does it compare with the default Cholesky decomposition available in EViews? They should be the same.

6Generating the ‘fundamental’ shocks

From the estimated structural VAR, how can we generate the fundamental shocks i.e. ut's in equation (1), using EViews? To generate the fundamental shocks, we use equation. Where etis the error or residual from the VAR regression which has been generated, and matrices A and B identified in the estimated SVAR. The fundamental shocks are then simply:

Q8. Generate the fundamental shocks from the SVAR

Answer: Select PROCS\MAKE RESIDUALS. EViews will automatically generate series named RESID?? in the same ordering as the VAR estimate. In this case we assume that they are RESID01, RESID02, RESID03, RESID04. Change the names as appropriate.

Create two matrices call them matx_a and matx_b by typing in the command window

matrix(4,4) matx_a

matrix(4,4) matx_b

and enter the estimated co-efficient from the estimated SVAR i.e.

matx_a values

1.000000 / 0.000000 / 0.000000 / 0.000000
0.000000 / 1.000000 / 0.000000 / 0.000000
0.000000 / 0.000000 / 1.000000 / 0.000000
0.000000 / 0.000000 / 0.000000 / 1.000000

matx_b values

1.101966 / -0.022506 / -0.298165 / 0.025184
0.002579 / 0.007326 / 0.000116 / 0.002695
0.281968 / -0.430771 / 0.470101 / 0.700787
-1.833790 / 0.327101 / -3.389196 / 1.608676

Type in the command window:

group resgrp RESID01 RESID02 RESID03 RESID04

matrix resmatrx=@convert(resgrp)

matrix resfund=@transpose(@inverse(matx_b) * matx_a * @transpose(resmatrx))

show resfund

Select View/graph/lineto see a plot of the errors:

We can see that shock volatility was higher in the first half of the sample.

7Estimating VARs in EViews 4.0

Estimating an unrestricted VAR is relatively straightforward in EViews 4.0, this was shown in question Q1. Identifying the VAR to obtain a Structural VAR by imposing certain identifying assumption is more involved and new techniques of doing this are available all the time. The question is then what identifying assumption can be imposed in EViews 4.0 and what can’t we impose? EViews is fairly flexible in that it only imposes two restrictions on the types of restrictions one can impose. This class of restrictions are known as AB class of restrictions (Amisano and Giannini, 1997).

We begin with our original structural equation that we wish to identify:

and we list each restriction that EViews assumes below:

Restriction 1. Matrices A and B are square and invertible.

This means that the number of the fundamental shocks (ui’s) is equal to the number of endogenous variables. This implicitly assumes each fundamental shock is identified uniquely with an endogenous variable.

For a given number of endogenous variables in the system, there is no a priori reason to assume that there are the same number fundamental shocks present. For instance it might more convenient to assume that there are fewer number of fundamental shocks, although in practice most researchers assume that the two are equal.

Restriction 2. Identifying restrictions can either be of the short run type characterised by equation (5) in section 3, or long run type characterised by equation (6) in section 4, but not both.

By imposing a long-run restriction (in matrix C described above) we infer a restriction on the values of matrices A and B, although such a restriction may not be simple. We often find that economic theory infer combinations of short-run and long-run relationships amongst a set of given variables. Combining short-run and long-run restrictions involve complex matrix algebra since we need to ensure that such combination do not contradict each other.

8References

Amisano,Gianni and Carlo Giannini (1997), Topics in structural VAR econometrics, Second edition. Heidelberg and New York: Springer.

Blanchard, O and D, Quah, The Dynamic Effects of Aggregate Supply and Demand Disturbances, American Economic Review (1989)

Lütkepohl, Helmut (1991). Introduction to Multiple Time Series Analysis, Springer-Verlag.

1

[1] Variable names in dataset in parenthesis.

[2] Some programs maximise the negative of these measures.

[3] Restriction using text form is also more flexible, as we can restrict values to be equal.