Learn R Programming

xtpqardl (version 1.0.1)

compute_irf: Compute Impulse Response Function

Description

Computes the impulse response function (IRF) for Panel Quantile ARDL models, showing the response to a one-unit shock via the error correction mechanism.

Usage

compute_irf(object, horizon = 20)

Value

A matrix with rows representing time periods and columns representing quantiles. Each entry shows the response at that period for that quantile.

Arguments

object

An object of class "xtpqardl".

horizon

Integer specifying the number of periods for the IRF. Default is 20.

Details

The IRF for the error correction model is computed as: $$IRF_t(\tau) = (1 + \rho(\tau))^t$$

which shows the decay of a unit shock over time through the error correction mechanism. Values approach zero as \(t \to \infty\) when \(-1 < \rho(\tau) < 0\).

Examples

Run this code
# \donttest{
data(pqardl_sample)
fit <- xtpqardl(
  formula = d_y ~ d_x1 + d_x2,
  data = pqardl_sample,
  id = "country",
  time = "year",
  lr = c("L_y", "x1", "x2"),
  tau = c(0.25, 0.50, 0.75)
)
irf <- compute_irf(fit, horizon = 15)
print(irf)
# }

Run the code above in your browser using DataLab