# NOT RUN {
data <- matrix(rnorm(400), ncol = 4)
x <- bvar(data, lags = 2, fcast = bv_fcast())
# Plot forecasts for all available variables
plot(predict(x))
# Alternatively
plot(x$fcast)
# Subset to variables in positions 1, 2 and 4 via position and name
plot(x$fcast, vars = c(1, 2, 4))
plot(x$fcast,
variables = c("gdp", "flux", "cpi", "capacitor"),
vars = c("gdp", "flux", "capacitor")
)
# Use the method to plot and adjust orientation
plot(x$fcast, orientation = "h")
# Adjust confidence bands via predict
plot(predict(x, conf_bands = c(0.01, 0.05)))
# }
Run the code above in your browser using DataLab