MATLAB code for inference on impulse responses using Local Projections or VARs.
Reference: Montiel Olea, José Luis, Mikkel Plagborg-Møller, Eric Qian and Christian K. Wolf (2026), "Double Robustness of Local Projections and Some Unpleasant VARithmetic" (arXiv)
Tested in: MATLAB R2025b on Macbook Pro 2023 (M3 Pro)
_data: Data for our analyses based on Ramey (2016) and Känzig (2021)
_estim: Functions for LP and VAR estimation and inference
- ir_estim.m: Main function for estimates and confidence intervals
analytics: Figures for analytical results
- plot_arbias.m: Plot the least-favorable MA polynomial for the local-to-AR(1) model
- run_ramey_ses.m: Compute LP and VAR SEs
- plot_worstcase.m: Generate the various analytical worst-case figures
documents: Detailed readme
- lp_varithmetic_readme.pdf: Detailed replication instructions plus supplementary information for replication of our empirical literature surveys
lit_lags: Results for our literature review on lag length selection for VARs
- lit_varlags_raw.csv: Raw, hand-collected data
- lit_varlags_eval.m: Plot summary statistics
simulations: Simulation study
- _aux: Auxiliary simulation-specific routines
- gen_varma_oil.m: Map oil VAR with 18 lags into a local-to-VAR representation
- simul_oil.m: Run simulations
- plot_oil.m: Generate figures
- Figures 4.1-4.3 and A.2-A.3. First run the file run_ramey_ses.m. Then execute plot_worstcase.m.
- Figures 5.1 and D.1. First run gen_varma_oil.m. Then execute simul_oil.m after setting the option "boot" to "true" for experiments "exp_id=1" and "exp_id=2." The relevant experiment type needs to be selected in plot_oil.m.
- Figure A.1. Run the file plot_arbias.m.
Our estimation routines build on the replication materials for Montiel-Olea and Plagborg-Møller (2021).
Plagborg-Møller acknowledges that this material is based upon work supported by the NSF under Grant #2238049 and by the Alfred P. Sloan Foundation, and Wolf does the same for NSF Grant #2314736.