Visualization of (out-of-sample) predictive distribution.
Arguments
- x
An object of type
bayesianVARs_predict
obtained viapredict.bayesianVARs_bvar()
.- dates
optional vector of dates for labeling the x-axis. The default values is
NULL
; in this case, the axis will be labeled with numbers.- vars
character vector containing the names of the variables to be visualized. The default is
"all"
indicating that all variables are visualized.- ahead
Integer vector (or coercible to such) indicating which step ahead to plot.
max(ahead)
must be smaller equal todim(x$predictions)[1]
.- quantiles
numeric vector indicating which quantiles to plot.
- n_col
integer indicating the number of columns to use for plotting.
- first_obs
integer indicating the first observation to be used 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.
#>
#> 385 stable posterior draws remaining for prediction!
# Visualize
plot(predictions, vars = 1:3, ahead = 1:3)