View source: R/utility_functions.R
summary.bayesianVARs_draws | R Documentation |
Summary statistics for bayesianVARs posterior draws.
## S3 method for class 'bayesianVARs_draws'
summary(object, quantiles = c(0.25, 0.5, 0.75), ...)
object |
An object of class |
quantiles |
A vector of quantiles to evaluate. |
... |
Currently ignored. |
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.
Available extractors: coef.bayesianVARs_bvar()
,
vcov.bayesianVARs_bvar()
.
# 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"))]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.