# NOT RUN {
# Set impulse responses to a horizon of 20 time periods and enable FEVD
# (Identification is performed via Cholesky decomposition)
bv_irf(horizon = 20, fevd = TRUE)
# Identify impulse responses using sign restrictions
data("fred_qd")
data <- fred_qd[, c("CPIAUCSL", "UNRATE", "FEDFUNDS")]
data[5:nrow(data), 1] <- diff(log(data[, 1]), lag = 4) * 100
data <- data[5:nrow(data), ]
# Signs should be based on economic theory
signs <- matrix(c(1, 1, -1, -1, 1, -1, -1, 1, 1), nrow = 3)
irf_signs <- bv_irf(sign_restr = signs)
# }
# NOT RUN {
bvar(data, lags = 5, irf = irf_signs)
# }
Run the code above in your browser using DataLab