Local Projections Impulse Response Functions

Provides functions to estimate and plot linear as well as nonlinear impulse responses based on local projections by Jordà (2005) .


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 impulse responses with identified shock and/or with 2SLS.
  • Functions to plot linear and nonlinear impulse responses.
  • Functions are partly implemented in Rcpp and RcppArmadillo to improve efficiency.
  • High performance with parallel computation.

Installation

You can install the released version of lpirfs from CRAN:

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”)

How to use

Examples can be found here.

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 comments and without whom I would have never started this project.

All remaining errors are obviously mine.

Development

I am currently working on a function for panel-lp estimation.

Author

Philipp Adämmer

License

GPL (>= 2)

News

lpirfs 0.1.3

  • Included an option to conduct 2SLS with lp_lin_iv.
  • Included an option to set the lag length of the endogenous variables in lp_lin_iv and lp_nl_iv to zero.
  • Deleted the deprecated plot functions plot_lin_irfs and plot_nl_irfs.
  • Improved documentation.
  • Changed input names in lp_lin_iv() and lp_nl_iv() for consistency:
function old input name new input name
lp_lin_iv() instr shock
lp_nl_iv() instr shock

lpirfs 0.1.2

  • Fixed an error in lp_nl() when lags are chosen by a lag length criterion. Version 0.1.1 chooses lags based on linear instead of nonlinear data.

  • Removed the dependency on the vars package.

  • lp_lin() and lp_nl() now allow to include exogenous variables and exogenous variables with contemporaneous impact.

  • plot_lin_irfs() and plot_nl_irfs() are deprecated and have been replaced by plot_lin() and plot_nl().

  • Two new functions named lp_lin_iv() and lp_nl_iv() allow to estimate linear and nonlinear impulse responses with identified shocks (instrument variables).

  • 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

lpirfs 0.1.1

  • The dependency on the mFilter package is removed. hp_filter() is now written in C++ to improve efficiency.

  • A problem with a C++ function is resolved so that the package can also be installed on Oracle Solaris.

  • Renamed functions:

original name new name
lm_function get_resids_ols
reduced_var get_mat_chol
find_lag_c get_vals_lagcrit
newey_west_c newey_west
switching_series get_vals_switching

lpirfs 0.1.0

  • First CRAN release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("lpirfs")

0.1.4 by Philipp Adämmer, 2 months ago


Report a bug at https://github.com/adaemmerp/lpirfs/issues


Browse source code at https://github.com/cran/lpirfs


Authors: Philipp Adämmer [aut, cre] , James P. LeSage [ctb] , Mehmet Balcilar [ctb]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports doParallel, dplyr, foreach, ggplot2, lmtest, plm, sandwich, Rcpp

Suggests testthat, ggpubr, gridExtra, httr, readxl

Linking to Rcpp, RcppArmadillo


See at CRAN