Learn R Programming

dcce (version 0.4.2)

irf: Impulse Response Functions for Dynamic Panel Models

Description

Computes impulse response functions (IRFs) from a fitted dynamic panel model (DCCE, CS-ARDL, or PMG). The IRF traces the response of the dependent variable to a one-unit shock in a specific regressor over a given number of horizons, using the Mean Group ARDL coefficient estimates and the autoregressive lag polynomial.

Usage

irf(object, impulse, horizon = 10L, boot_reps = 200L, seed = NULL)

Value

An object of class dcce_irf containing the impulse response path ($irf), optional bootstrap lower/upper bands, and metadata (impulse variable name and horizon length).

Arguments

object

A dcce_fit object from a dynamic model (must contain at least one L(y, k) term).

impulse

Character: the regressor that receives the shock.

horizon

Integer: number of periods to trace. Default 10.

boot_reps

Integer: bootstrap replications for confidence bands. 0 = no bands. Default 200.

seed

Integer: random seed.

Details

Confidence bands are computed via the cross-section bootstrap: units are resampled with replacement, the MG coefficients are recomputed, and the IRF is re-traced. The 2.5 and 97.5 percent quantiles of the bootstrap distribution form the 95 percent band.

Examples

Run this code
data(dcce_sim)
fit <- dcce(
  data = dcce_sim, unit_index = "unit", time_index = "time",
  formula = y ~ L(y, 1) + x,
  model = "dcce", cross_section_vars = ~ ., cross_section_lags = 3
)
ir <- irf(fit, impulse = "x", horizon = 10, boot_reps = 0)
print(ir)

Run the code above in your browser using DataLab