| compute_irf | R Documentation |
Computes structural impulse responses from an estimated pvarife_result
using a recursive (lower-triangular Cholesky) identification scheme. The
identification follows the short-run restriction approach of Tugan (2021).
compute_irf(
fit,
n_periods,
shock = 1L,
diff_vars = integer(0),
identification = c("short_run", "long_run"),
bias_correct = FALSE
)
fit |
An object of class |
n_periods |
Positive integer. Number of IRF horizons to compute. |
shock |
Positive integer. Index of the structural shock (1 = first variable in the ordering). Default is 1. |
diff_vars |
Integer vector. Indices of variables for which cumulative
IRFs are reported (e.g., for variables entered in first differences).
Default is |
identification |
Character. Either |
bias_correct |
Logical. If |
The MA representation is computed recursively:
B_0 = I_K, \quad B_h = \sum_{l=1}^{\ell} \Theta_l B_{h-l},
with the convention B_j = 0 for j < 0.
Short-run identification (default): The impact matrix is the
lower-triangular Cholesky factor of \hat\Sigma:
A_0 = \mathrm{chol}(\hat\Sigma)^\top.
Long-run identification (Blanchard-Quah type): The long-run
multiplier C(1) = (I - \sum_\ell \Theta_\ell)^{-1} A_0 is constrained
to be lower-triangular. The impact matrix is
A_0 = (I - \Theta)\,\mathrm{chol}(D)^\top,
where \Theta = \sum_{\ell=1}^{L} \Theta_\ell and
D = (I - \Theta)^{-1} \hat\Sigma (I - \Theta)^{-\top}.
This identification restricts shock 1 to have no long-run effect on variable 2
(in a 2-variable system). Faithful to IRs_to_Shocks_LR_Identification.m
in the Monte Carlo replication code.
Bias correction: When bias_correct = TRUE, the impact matrix
is evaluated at the bias-corrected coefficient vector
\hat\beta - \hat b from asymptotic_var. The uncorrected
estimator is used by default (bias_correct = FALSE) for speed; users
who need confidence bands can rely on irf_bands, whose
median is already implicitly bias-corrected.
The impulse response to shock s at horizon h is
B_h A_0 e_s where e_s is the s-th standard basis vector.
A matrix of dimension K \times n\_periods. Row k gives
the response of variable k to the structural shock at horizons
1, \ldots, n\_periods. The object has class
c("pvarife_irf", "matrix").
Tugan, M. (2021). Panel VAR models with interactive fixed effects. Econometrics Journal, 24, 225–246. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/ectj/utaa021")}
irf_bands, bootstrap_irf_bands
sim <- sim_pvarife(n_units = 30, n_time = 20, n_vars = 2,
n_lags = 1, n_factors = 1, seed = 1)
fit <- pvarife(sim$y, n_lags = 1, n_factors = 1, n_out = 5, n_in = 3)
ir <- compute_irf(fit, n_periods = 8)
dim(ir) # 2 x 8
# Long-run identification
ir_lr <- compute_irf(fit, n_periods = 8, identification = "long_run",
diff_vars = 1L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.