Matlab code for large-scale simulation studies of impulse response estimators, including Local Projections (LPs), Vector Autoregressions (VARs), and several variants of these
Reference: Li, Dake, Mikkel Plagborg-Møller, and Christian K. Wolf (2024), "Local Projections vs. VARs: Lessons From Thousands of DGPs" (paper, supplement)
Tested in: Matlab R2023a on Windows 10 PC (64-bit)
Documents: Paper, supplement, and documentation
- lp_var_simul.pdf: Main paper
- lp_var_simul_supplement.pdf: Online supplement
- lp_var_simul_companion.pdf: Technical documentation
Estimation_Routines: General-purpose impulse response estimation functions
- BVAR_est.m: Bayesian VAR (Giannone, Lenza & Primiceri, 2015)
- LP_est.m: Least-squares LP (with optional bias correction as in Herbst & Johanssen, 2023)
- LP_shrink_est.m: Penalized LP (Barnichon & Brownlees, 2019)
- SVAR_est.m: Least-squares VAR (with optional bias correction as in Pope, 1990)
- SVAR_IV_est.m: Least-squares SVAR-IV
- VAR_avg_est.m: VAR model averaging (Hansen, 2016)
DFM: Simulation study based on encompassing Dynamic Factor Model (DFM)
- run_dfm.m: Main file for executing simulations
- run_combine.m: Combines simulation data files from multiple DGPs
- Reporting: Folder with files that produce results figures and tables
- run_plot_dgp.m: Plots and tables of DGP summary statistics (Table 1 and Figure 1 in the paper)
- run_plot_loss.m: Plots of bias, standard deviation, median bias, and interquartile range (Figures 2-3 and 10-11 in the paper)
- run_plot_tradeoff.m: Plots of head-to-head loss function comparisons and best method (Figures 4-9 in the paper)
- settings_shared.m: Shared settings for plotting functions
- Settings: Folder with simulation settings
- Subroutines: Folder with data for calibrating the DFM and various functions for simulation and computing summary statistics
- SW_DFM_Estimation: DFM code and data adapted from Lazarus, Lewis, Stock & Watson (2018)
We rely on BVAR code by Domenico Giannone, Michele Lenza & Giorgio Primiceri, penalized LP code by Regis Barnichon & Christian Brownlees, as well as VAR model averaging code by Bruce Hansen. We have slightly modified these sets of code to improve their run-time without affecting their numerical output. We also use Dynamic Factor Model code and data by Eben Lazarus, Daniel Lewis, Jim Stock & Mark Watson.
Plagborg-Møller acknowledges that this material is based upon work supported by the NSF under Grant #2238049, and Wolf does the same for Grant #2314736.