| irf | R Documentation |
Computes orthogonalized impulse response functions (IRF) from an RBFM-VAR model with optional bootstrap confidence intervals.
irf(object, horizon = 20, ortho = TRUE, boot = 0, ci = 90, seed = NULL)
object |
An |
horizon |
Integer. Number of periods for the IRF. Default is 20. |
ortho |
Logical. If |
boot |
Integer. Number of bootstrap replications for confidence intervals. If 0 (default), no bootstrap is performed. |
ci |
Numeric. Confidence level for bootstrap intervals (0-100). Default is 90. |
seed |
Integer. Random seed for reproducibility. Default is |
The IRF measures the response of each variable to a one-standard-deviation
shock in each of the structural innovations. When ortho = TRUE,
the structural shocks are identified using the Cholesky decomposition of
the residual covariance matrix (recursive identification).
Bootstrap confidence intervals are computed using the recursive-design bootstrap following Kilian (1998).
An object of class "rbfmvar_irf" containing:
Array of IRF values (horizon x n x n). Element [h, i, j] is the response of variable i to a shock in variable j at horizon h.
Lower confidence bounds (if bootstrap was performed).
Upper confidence bounds (if bootstrap was performed).
IRF horizon.
Variable names.
Whether orthogonalized IRFs were computed.
Number of bootstrap replications.
Confidence level.
Kilian, L. (1998). Small-Sample Confidence Intervals for Impulse Response Functions. Review of Economics and Statistics, 80(2), 218-230. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1162/003465398557465")}
Lutkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. Springer-Verlag. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-540-27752-1")}
# Simulate VAR data
set.seed(123)
n <- 200
e <- matrix(rnorm(n * 3), n, 3)
y <- matrix(0, n, 3)
colnames(y) <- c("y1", "y2", "y3")
for (t in 3:n) {
y[t, ] <- 0.3 * y[t-1, ] + 0.2 * y[t-2, ] + e[t, ]
}
fit <- rbfmvar(y, lags = 2)
ir <- irf(fit, horizon = 20)
plot(ir)
# With bootstrap confidence intervals
ir_boot <- irf(fit, horizon = 20, boot = 500, ci = 95)
plot(ir_boot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.