Visualization of in-sample fit. Can also be used to display prediction intervals of future values.
Arguments
- x
An object of class
bayesianVARs_bvar
obtained viabvar()
.- predictions
Optional array of out of sample predictions, e.g. obtained via
predict.bayesianVARs_bvar()
.- quantiles
numeric vector indicating which quantiles to plot.
- dates
optional vector of dates for labelling the x-axis. The default values is
NULL
; in this case, the axis will be labeled with numbers.- n_col
integer indicating the number of columns to use for plotting.
- ...
Currently ignored!
Examples
# 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 from posterior predictive
predictions <- predict(mod, ahead = 1:3)
#> 'stable=TRUE': Calling 'stable_bvar()' to discard those posterior
#> draws, that do not fulfill the stable criterion.
#>
#> 626 stable posterior draws remaining for prediction!
# Visualize
plot(mod, predictions = predictions)