Summary statistics for bayesianVARs posterior draws.
Source:R/utility_functions.R
summary.bayesianVARs_draws.Rd
Summary statistics for bayesianVARs posterior draws.
Arguments
- object
An object of class
bayesianVARs_draws
usually obtained through extractors likecoef.bayesianVARs_bvar()
andvcov.bayesianVARs_bvar()
.- quantiles
A vector of quantiles to evaluate.
- ...
Currently ignored.
Value
A list object of class bayesianVARs_draws_summary
holding
mean
: Vector or matrix containing the posterior mean.sd
: Vector or matrix containing the posterior standard deviation .quantiles
: Array containing the posterior quantiles.
See also
Available extractors: coef.bayesianVARs_bvar()
,
vcov.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)
# Extract posterior draws of VAR coefficients
bvar_coefs <- coef(mod)
# Compute summary statistics
summary_stats <- summary(bvar_coefs)
# Compute summary statistics of VAR coefficients without using coef()
summary_stats <- summary(mod$PHI)
# Test which list elements of 'mod' are of class 'bayesianVARs_draws'.
names(mod)[sapply(names(mod), function(x) inherits(mod[[x]], "bayesianVARs_draws"))]
#> [1] "PHI" "U" "logvar" "sv_para" "facload" "fac"