Sie sind auf Seite 1von 9

SVAR-models in Stata - Brief Introduction

Anton Parlow
Lab session Econ710
UWM Econ Department

04/08/2011

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

1/9

Our plan

Introduction to SVAR
Short Run SVAR
Impulse Response Functions
Long Run SVAR and IRF

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

2/9

Introduction to SVAR models

A structural vector-autoregressive (SVAR) model imposes restrictions on the response of variables on each other based on the
underlying VAR model. The goal is to give impulse response functions, as well the variance decomposition a more causal
meaning. You can do them after a VAR but you dont impose any restrictions e.g. implied by economic theory. We would not
know what causes this shock in a normal VAR.
We want to know what is the effect of an unit shock of one variable on another variable, while imposing restrictions e.g. current
GDP has no effect on current defense spending but current defense spending has an effect on current GDP would be one
restriction.
We can use short SVAR models where current values affect each other (= contemporaneous effect) which is not a long lasting
effect, or long run SVAR models where one variable has a long lasting effect e.g. GDP does not go back to its initial level.
For the short run restrictions have to be placed on the A and B matrix, where A matrix is the one you will focus. The B matrix
places restrictions on the error structure or the matrix.
For the long run case, you will place restrictions on the C matrix in Stata.

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

3/9

Short Run SVAR

Specifying a short run SVAR is about the A-matrix. Usually you will not change the B-matrix as it is supposed to be e.g.
assuming the covariance between two variables are unrelated and estimating the own variance.
Imagine we just have defense spending and GDP, which results in a 2x2 matrix. Also note those matrices have to be square all
the time! Another note if you have three variables you will get a 3x3 matrix and so on
An example for the B-matrix:

B =

.
0

0
.

The . means that this will be estimated by Stata. You can list the result after your estimation by matrix list e(B) and the
specified matrix by matrix list B
The Stata command would be: matrix B = (.,0\0,.)
You see that the diagonal elements are just
2

E (i )
and the off-diagonal are
E (i j ) = 0
at time t. Reflects our standard assumptions on the error-terms. Anyway, you could also restrict the diagonal terms to 1 if you
need it.

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

4/9

Short Run SVAR..

The A-matrix is more interesting. Again the simple 2x2 example from above. In general the A-matrix imposes restrictions on the
off-diagonal terms. The diagonal terms reflect the unit change of element i on i or on itself e.g. if defense spending increases
this should have a 1:1 response = you will see a 1 for diagonal terms. Same for GDP.
So to make it more intuitively:

A=

i i
i j

j i
j j

Let defense spending be i and GDP be j. Assume the own-effect has to be one (makes sense!). Assume current GDP j has no
effect on current DS i so that j i = 0 and assume that current DS has an effect on current GDP so that i j = .. Again
the . will be estimated by Stata.

A=

1
.

0
1

In Stata you would write: matrix A = (1,0\.,1)


Note: You have to specify those matrices before running the SVAR.

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

5/9

Short Run SVAR..


Steps:
1. Specify the A and B matrix
2. Run the SVAR
3. IRF = want to focus on the cumulative effect
In Stata:
1.
matrix A = (1,0\.,1)
matrix B = (.,0\0,.)
2.
svar flrgdp flds L.lds L.flrgdp, aeq(A) beq(B)
Note: Has to be the same order as your A-matrix e.g. if DS is element i it should be the first variable in the SVAR command.
Otherwise you will get different results.
3. IRF contains three steps: set, create and graph
irf set "impulses.irf"
= give the IRF a name
irf create test2, step(10)
= create the actual impulse response function and use 10 lags (= steps)
irf graph irf
= graph it, all in one huge picture and not cumulative
or
irf graph oirf, impulse(flds) response(flrgdp)
= orthogonal IRF (=oirf) for the file impulse and the impulse comes from DS and GDP responses to it. We will get a
cumulative response and a confidence interval too.
Note: There are many different IRFs (Cholesky, Dynamic Multipliers, Structural Response..). E.g.
irf ograph (impulse flrgdp flds cirf, ci) would give you a dynamic multiplier using an overlaid graph showing a
negative effect, which reflects the value in the A-matrix (next slide).
Anton Parlow Lab session Econ710 UWM Econ
SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

6/9

Impulse Response function example


Let us look at the effect of DS on GDP. We use irf graph oirf, impulse(flds) response(flrgdp)
and get following impulse response function:

Current Defense has initially a small positive effect on GDP but after two periods it becomes negative and dies out 10 quarters
(or so). There is no long-run / long-lasting effect on GDP. You will see the long-run SVAR gives us the same result.
Another way (or two ways) is the get the estimate for the value in the A-matrix and for the Cholesky decomposition itself. The
A-matrix gives you a negative impact, while the actual Cholesky decomposition shows you the small positive effect from above.

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

7/9

Impulse Response function example..

We get the estimated A-matrix with: matrix list e(A) (and similarly for B)

A=

1
.0472823

0
1

Anyway, you will also find this value in the SVAR output.
To get the Cholesky decomposition value (or cumulative impact on current values, if you want):
matrix chol=e(Sigma)
where chol is just a name you give it. Remember Sigma is your variance-covariance matrix.
Next
matrix chol2=cholesky(chol)
= creates the Cholesky matrix and finally
matrix list chol2
You see a small positive effect of current DS on GDP. A 1% increase in current DS affects current GDP by 0.13%


.02918474
0
Cholesky =
.00137992
.0091213
You can also graph the own reaction / response if you want to.

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

8/9

Long Run SVAR and IRF

As before let us assume only defense spending have a long run effect on GDP. The C-matrix would like this:

C =

1
.

0
1

which would be the following in Stata:


matrix C = (1,0\.,1)
And following command runs the long run SVAR:
svar flds flrgdp , lreq(C)
The estimated C-matrix would be the following

C =

1
.0408636

0
1

And if we do the same Cholesky decomposition for the IRF as above, we will see exactly the same IRF again. We get a positive
effect of defense spending on GDP but over time it becomes negative (shortly after) and dies out. Or is has no long lasting
effect on GDP.

Anton Parlow Lab session Econ710 UWM Econ


SVAR-models
Department
in Stata
() - Brief Introduction

04/08/2011

9/9

Das könnte Ihnen auch gefallen