About
An R-package which estimates linear and nonlinear impulse responses with local projections by Jordà (2005).
Main features
- Estimates linear and nonlinear impulse responses with local projections.
- Estimates linear and nonlinear impulse responses with local projections and instrument variables (development version).
- Functions to plot linear and nonlinear impulse responses.
- Functions are partly implemented in Rcpp and RcppArmadillo to improve efficiency.
- High performance with parallel computation.
Updates and new features in the development version
Fixed an error in lp_nl when the number of lags is chosen by a lag length criterion. The version on CRAN (0.1.1) chooses lags based on linear data instead of nonlinear lagged data.
All functions now allow to include (lagged) exogenous data and data with contemporaneous impact.
Two new functions allow to estimate linear (lp_lin_iv) and nonlinear (lp_nl_iv) impulse responses with local projections via instrument variables as in, e.g., Ramey and Zubairy (2018).
All functions now allow to manually choose the number of cores.
Some input names in lp_lin and lp_nl have been changed for consistency:
function | old input name | new input name |
---|---|---|
lp_lin() | lags_lin | lags_endog_lin |
lp_nl() | lags_lin | lags_endog_lin |
lp_nl() | lags_nl | lags_endog_nl |
lp_nl() | hp_filter | use_hp |
Examples
Examples can be found here.
Installation
You can install the released version (0.1.1) of lpirfs from CRAN with:
install.packages("lpirfs")
You can install the development version of lpirfs from GitHub:
# install.packages("devtools")
devtools::install_github("AdaemmerP/lpirfs")
The package compiles some C++ source code for installation, which is why you need the appropriate compilers:
On Windows you need Rtools available from CRAN.
On macOS you need the Clang 6.x compiler and the GNU Fortran compiler from macOS tools. Having installed the compilers, you need to open a terminal and start R via ‘PATH=/usr/local/clang6/bin:$PATH R’. Yo can then install the package via devtools::install_github(“AdaemmerP/lpirfs”)
Acknowledgements
I am thankful to Òscar Jordà for encouraging comments and helpful suggestions. I am also indebted to Sarah Zubairy for providing the Matlab code before the publication of their paper.
I greatly benefit from the profound R, Rcpp and GitHub knowledge of Philipp Wittenberg and Detlef (overflow) Steuer. Last but not least, I am grateful to Philipp Dybowski for his rigorous comments and without whom I would have never started this project.
All remaining errors are obviously mine.
Development
I intend to further extend the package with functions that
- allow to manually identify the linear combinations of the reduced form residuals,
- conduct panel-lp estimation.
Author
Philipp Adämmer
License
GPL (>= 2)