# NOT RUN {
data <- matrix(rnorm(200), ncol = 2)
x <- bvar(data, lags = 2)
# Access forecast and update confidence bands
predict(x, conf_bands = 0.01)
# Adjust, compute and store a longer forecast
x$fcast <- predict(x, horizon = 24L)
# Lower draws, use `bv_fcast()` to set options and add confidence bands
predict(x, bv_fcast(24L), n_thin = 10L, conf_bands = c(0.05, 0.16))
# Use new data to calculate a prediction
predict(x, newdata = matrix(rnorm(200), ncol = 2))
# Get a summary of the last saved forecast
summary(x)
# Limit the summary to variable #2
summary(x, vars = 2L)
# }
Run the code above in your browser using DataLab