# Access a subset of the usmacro_growth dataset
data <- usmacro_growth[,c("GDPC1", "CPIAUCSL", "FEDFUNDS")]
# Estimate a model
mod <- bvar(data, sv_keep = "all", quiet = TRUE)
# Simulate predicted historical values including the error term.
pred <- fitted(mod, error_term = TRUE)
# Simulate fitted historical values not including the error term.
fit <- fitted(mod, error_term = FALSE)
# Visualize
plot(pred)
plot(fit)
Run the code above in your browser using DataLab