
Pairwise visualization of out-of-sample posterior predictive densities.
Source:R/plots.R
pairs_predict.RdPairwise visualization of out-of-sample posterior predictive densities.
Usage
# S3 method for class 'bayesianVARs_predict'
pairs(x, vars, ahead, ...)Arguments
- x
An object of class
bayesianVARs_predictobtained viapredict.bayesianVARs_bvar().- vars
Integer vector (or coercible to such) indicating which variables to plot.
- ahead
Integer vector (or coercible to such) indicating which step ahead to plot.
max(ahead)must be smaller equal todim(x$predictions)[1].- ...
Currently ignored!
Note
Note that that bayesianVARs_predict can also be used withing plot.bayesianVARs_bvar().
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.
#>
#> 522/1000 stable posterior draws remaining for prediction!
# Visualize
pairs(predictions, vars = 1:3, ahead = 1:3)