Matlab code for inference on variance decompositions and the degree of invertibility/recoverability in a general Structural Vector Moving Average (SVMA) model identified by external instruments (IVs, also known as proxies)
Reference: Plagborg-Møller, Mikkel and Christian K. Wolf (2022), "Instrumental Variable Identification of Dynamic Variance Decompositions", Journal of Political Economy 130(8), 2164-2202 (also available as arXiv:2011.01380)
Tested in: Matlab R2020a on Windows 10 PC (64-bit)
Other versions: Python code written by João B. Duarte
functions: Matlab routines
- SVMAIV_estim.m: main function for SVMA-IV inference
- SVARIV_estim.m: SVAR-IV inference (assumes invertibility)
applications: empirical applications
- gk/run_gk.m: application based on Gertler & Karadi (2015)
- kaenzig/run_kaenzig.m: application based on Känzig (2021)
illustration: numerical illustration
- run_sw.m: SVMA-IV and SVAR-IV analysis of Smets & Wouters (2007) model
simulations: simulation study
- run_sim.m: run Monte Carlo experiments for various DGPs
- print_results.m: display results for all DGPs
addpath('functions');
% Given (T x n_y) data matrix Y with endogenous variables
% and (T x 1) data vector Z with external instrument
[bounds, id_recov, inv_test] = ...
SVMAIV_estim(Y, Z, ...
'ic', 'aic', ... % Select lag length using AIC
'signif', 0.1, ... % 10% significance level
'n_boot', 500, ... % 500 bootstrap iterations
'horiz', 1:24); % Compute horizons 1-24 of FVR/FVD
Output:
bounds
structure: partial identification boundsbounds.estim
: point estimates of boundsbounds.ci
: confidence intervals for identified set
id_recov
structure: results under additional assumption of recoverabilityid_recov.estim
: point estimates of parametersid_recov.ci
: confidence intervals for parameters
inv_test
structure: pre-test for invertibility, implemented as a Granger casuality test, either in all equations jointly (subfieldall
) or in each y equation separately (subfieldeqns
)inv_test.wald_stat
: Wald statisticsinv_test.df
: degrees of freedominv_test.pval
: p-values
Parameter names:
alpha
: scale parameterR2_inv
: degree of invertibilityR2_recov
: degree of recoverabilityFVR
: forecast variance ratioFVD
: forecast variance decomposition
See our empirical applications for concrete examples of how to use the code. Additional optional arguments to SMVAIV_estim.m
are listed at the top of the function.
The figures and tables in our paper and supplement are produced as follows:
- Figures 1 and B.7 and Table 1: applications/gk/run_gk.m
- Table 2: First run simulations/run_sim.m nine separate times, with the variable
model.dgp
at the top set to each of the options0
through8
. Then run simulations/print_results.m - Figures B.1-B.6 and Table B.1: illustration/run_sw.m
- Figures B.8-B.11: applications/kaenzig/run_kaenzig.m
We are grateful to Diego Känzig for allowing us to reproduce some of the data files used in his 2021 AER paper.
Wolf acknowledges support from the Alfred P. Sloan Foundation and the Macro Financial Modeling Project. Plagborg-Møller acknowledges that this material is based upon work supported by the National Science Foundation under Grant #1851665.