Learn R Programming

⚠️There's a newer version (0.2.4) of this package.Take me there.

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 identified shock and/or with 2SLS.
  • Estimates linear and nonlinear impulse responses with local projections for panel data.
  • Functions to plot linear and nonlinear impulse responses.
  • Functions are partly implemented in Rcpp/RcppArmadillo and partly written for parallel computation to improve efficiency.

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.

Author

Philipp Adämmer

License

GPL (>= 2)

Copy Link

Version

Install

install.packages('lpirfs')

Monthly Downloads

1,075

Version

0.1.4

License

GPL (>= 2)

Maintainer

Philipp Ad<c3><a4>mmer

Last Published

December 11th, 2018

Functions in lpirfs (0.1.4)

lp_lin_iv

Compute linear impulse responses with identified shock and/or with 2SLS
get_vals_switching

Compute values of transition function to separate regimes
lp_lin

Compute linear impulse responses
lpirfs-package

Local Projection Impulse Response Functions
create_lags

Compute a data frame with lagged exogenous variables
get_var_lagcrit

Computes AICc, AIC and BIC for VAR
newey_west

Compute OLS parameters and robust standard errors based on Newey-West estimator
lp_lin_panel

Compute linear impulse responses with local projections for panel data
ag_data

Data to estimate fiscal multipliers
hp_filter

Decompose a times series via the Hodrick-Prescott filter
monetary_var_data

Data to estimate a standard monetary VAR
create_lin_data

Compute data for linear model
se_hc_panel_cluster

Create and returns a function to estimate hc and clustered standard errors for panel data.
newey_west_tsls

Compute 2SLS parameters and robust standard errors based on Newey-West
interest_rules_var_data

Data to estimate the effects of interest rate rules for monetary policy
get_resids_ols

Compute residuals from OLS model
create_nl_data

Compute data for nonlinear model with instrument variable approach
create_panel_data

Prepare data sets for linear and nonlinear panel model
get_vals_lagcrit

Compute values for lag length criteria
get_mat_chol

Compute structural shock matrix via Cholesky decomposition
lp_nl_iv

Compute nonlinear impulse responses with identified shock
plot_nl

Compute and display plots of nonlinear impulse responses
lp_nl_panel

Compute nonlinear impulse responses for panel data
plot_lin

Compute and display plots of linear impulse responses
lp_nl

Compute nonlinear impulse responses