tidyMacro
High-Performance Vector Autoregression in R
tidyMacro is an R package for fast estimation of Vector Autoregression (VAR) models via C++ (Rcpp/RcppArmadillo).
TipFunctionality
- Fast VAR & VARX reduced form estimations
- Zero dependency on other packages. Ground up written in C++. All visualizations made with
ggplot2in R. - Publication-ready plots out of the box. Each plot is a ggplot2 object, can be ex post customized
- The package comes with a proper theme:
set_tidyMacro_theme() - Parallel bootstrap computations via OpenMP for maximum speed. You can avoid parallel computations using n_threads = 1. Without using this option, n-1 cores will be used for parallel computations, where n is the number of cores in your Mac/PC.
- If you encounter a problem when Rstudio/Positron kicks you out, you may use this option.
- Excellent documentation with detailed examples for every function
- Import data via tidyverse, clean, modify and then supply your final data piping
as.matrix()for Armadillo calculations - Example data sets for each replication: Already transformed data
ImportantModels - Identification - Decompositions
- Identification via short-run / recursive ordering ✅
- Impulse response functions ✅
- Residual based bootstraps
- Wild bootstraps
- Bias corrected impulse Response functions ✅
- Variance Decomposition ✅
- Historical Decomposition ✅
- Replication: Bloom (2009)
- Impulse response functions ✅
- Identification via long run restrictions
- Identification via external instruments (Proxy-SVAR) ✅
- Impulse Response functions ✅
- Moving block bootstraps
- Forecast error variance Decomposition ✅
- Historical Decomposition ✅
- First Stage F-stats ✅
- Recovering the shock series ✅
- Unit normalization
- One SD normalization
- Weak IV Robust IRF ✅
- Delta method
- Anderson-Rubin
- Replication: Känzig (2021)
- External instrument SVAR analysis for noninvertible shocks following Forni et al. (2022) ✅
- Impulse Response functions ✅
- Identification via Internal instruments ✅
- Adding instrument to VAR as the first variable, then IRF identified recursively
- Other options in short run / recursive identification apply here
- Replication: Känzig (2021)
- Identification via Heteroskedasticity following Rigobon (2003) ✅
- Impulse Response functions ✅
- Replication: Känzig (2021)
- Identification via Sign, Narrative and Zero Restrictions ⛔
- Identification via Non-Gaussianity ⛔
- Local Projections ⛔
- Local projections with Exogenous Shocks
- Local projections IV
- Panel Local projections
- State Dependent Local projections
- Bayesian Local projections
References
Beaudry, Paul, and Franck Portier. 2014. “News-Driven Business Cycles: Insights and Challenges.” Journal of Economic Literature 52 (4): 993–1074. https://doi.org/10.1257/jel.52.4.993.
Bloom, Nicholas. 2009. “The Impact of Uncertainty Shocks.” Econometrica 77 (3): 623–85. https://doi.org/10.3982/ECTA6248.
Forni, Mario, Luca Gambetti, and Giovanni Ricco. 2022. External Instrument SVAR Analysis for Noninvertible Shocks. https://warwick.ac.uk/fac/soc/economics/research/workingpapers/2022/twerp_1444_-_ricco.pdf.
Galí, Jordi. 1999. “Technology, Employment, and the Business Cycle: Do Technology Shocks Explain Aggregate Fluctuations?” American Economic Review 89 (1): 249–71. https://doi.org/10.1257/aer.89.1.249.
Gertler, Mark, and Peter Karadi. 2015. “Monetary Policy Surprises, Credit Costs, and Economic Activity.” American Economic Journal: Macroeconomics 7 (1): 44–76. https://doi.org/10.1257/mac.20130329.
Känzig, Diego R. 2021. “The Macroeconomic Effects of Oil Supply News: Evidence from OPEC Announcements.” American Economic Review 111 (4): 1092–125. https://doi.org/10.1257/aer.20190964.
Rigobon, Roberto. 2003. “Identification Through Heteroskedasticity.” The Review of Economics and Statistics 85 (4): 777–92. https://doi.org/10.1162/003465303772815727.