You are on page 1of 9

Quantitative Macroeconomics

Estimating SVARs in Practice

Andreas Tischbirek

Department of Economics
HEC Lausanne

7 December 2020
Introduction

Last week—Theoretical introduction to SVARs


Today—Estimating SVARs in Stata
Replicate a set of impulse response functions (IRFs) shown in a paper
by Stock and Watson published in the Journal of Economic
Perspectives
Stock and Watson (2001) estimate the impulse responses of inflation,
unemployment, and the interest rate to exogenous shocks to these
three variables using US data for 1960Q1 until 2000Q4
Important steps in replicating their results are
Obtaining data, importing it in Stata and transforming it in an
appropriate way
Estimating the SVAR with the correct identifying restrictions
Generating the IRFs

UNIL-HEC SVARs Exercise 7 December 2020


IRFs fromFigure
Stock1 and Watson (2001)
Impulse Responses in the Inflation-Unemployment-Interest Rate Recursive VAR

Inflation Shock to Inflation Shock to Inflation Shock to


Inflation Unemployment Interest Rate

-- -- -
- -- -- -

o ---
-- -~~~~~~--
- - -- - - -- - - 0
-- ~~~~~~~~~~~~~~~~~~~~~~~~-
- ----------

6 --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~------------
00 4 8 12 16 20 24 10 4 8 12 16 20 24 00 4 8 12 16 20 24
Lag Lag Lag

Unemployment Shock to Unemployment Shock to Unemployment Shock to


0 Inflation Unemployment Interest Rate

- --- ---
--- - - -

C. ---~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--------

I0 4 8 12 16 20 24 10 4 8 12 16 20 24 0 4 8 12 16 20 24
Lag Lag Lag

Interest Rate Shock to Interest Rate Shock to Interest Rate Shock to


whileforInflation Unemployment Interest Rate

6~~~~~~~~~~~~~~
I0 4 8 12 16 20 24 10 4 8 12 16 20 24 10 4 8 12 16 20 24
Lag Lag Lag

UNIL-HEC SVARs Exercise 7 December 2020


Step 1 – Data Set
Go to https://research.stlouisfed.org/fred2/ and download
the following time series for 1960Q1 to 2000Q4
effective federal funds rate
civilian unemployment rate
GDP implicit price deflator published by the US BEA
(1959Q4 needed to construct inflation)
Copy the time series into a single excel file with the variable names in
the first row and load them into Stata using

import excel filename.xls, firstrow

Generate a variable “time” (ranging from 1959Q4 to 2000Q4) with

generate time = tq(1959Q4) + n − 1


format time %tq

UNIL-HEC SVARs Exercise 7 December 2020


Step 1 – Data Set

To specify that the data consists of quarterly time series with the
variable “time” giving the observation period, one can write

tsset time, quarterly

Generate a variable which gives the (annualised) inflation rate


(L.Variable is the first lag of a variable)
Rename the remaining variables in a convenient way
Drop data pertaining to 1959Q4
Plot the data

UNIL-HEC SVARs Exercise 7 December 2020


Step 2 – Imposing Parameter Restrictions
The svar command in Stata is based on the following model
Ayt = A(A1 yt−1 + A2 yt−2 + . . . + Ap yt−p ) + Bet
where et ∼ N(0, IK ) and IK is the identity matrix of dimension K
(Note the differences in notation from last week’s lecture)
One has to specify the matrices A and B before the estimation
Imposing standard Cholesky restrictions on A and B
Specify B as
 
. 0 0
B = 0 . 0
0 0 .
using the command
matrix B = (., 0, 0 \ 0, ., 0 \ 0, 0, .)
where “.” means that the parameter in this place is unconstrained
How does A have to be entered?
UNIL-HEC SVARs Exercise 7 December 2020
Step 3 – Estimation and IRFs

Estimate the SVAR using inflation, unemployment and the interest


rate (think about the ordering!) with 4 lags
The appropriate Stata command is

svar variable list, lags(1/4) aeq(A) beq(B)

A lot of additional options can be specified with the svar command


(see https://www.stata.com/manuals/tsvarsvar.pdf)
IRFs for 24 periods and 66% confidence intervals can then be
generated with

irf create filename, step(24) set(filename, replace)


irf graph sirf , level(66)

UNIL-HEC SVARs Exercise 7 December 2020


Interpretation and Robustness

Do the IRFs behave in an economically plausible way?


How is the identification strategy reflected in the IRFs?
What is your assessment of the ordering of the variables?
Examine the robustness of the results with respect to the ordering of
the variables. How do the IRFs change if the interest rate is put in a
different position?
Are the results robust with respect to changes in the lag length of the
SVAR?

UNIL-HEC SVARs Exercise 7 December 2020


References

Mandatory Reading
https://www.stata.com/manuals/tsvarsvar.pdf, pp. 7-9
Further Reading
Stock, James H. and Mark W. Watson (2001): “Vector
Autoregressions”, The Journal of Economic Perspectives, 15(4), pp.
101-115

UNIL-HEC SVARs Exercise 7 December 2020

You might also like