Learn R Programming

bayesianVARs (version 0.1.6)

summary.bayesianVARs_draws: Summary statistics for bayesianVARs posterior draws.

Description

Summary statistics for bayesianVARs posterior draws.

Usage

# S3 method for bayesianVARs_draws
summary(object, quantiles = c(0.25, 0.5, 0.75), ...)

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.

Arguments

object

An object of class bayesianVARs_draws usually obtained through extractors like coef.bayesianVARs_bvar() and vcov.bayesianVARs_bvar().

quantiles

A vector of quantiles to evaluate.

...

Currently ignored.

See Also

Available extractors: coef.bayesianVARs_bvar(), vcov.bayesianVARs_bvar().

Examples

Run this code

# 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"))]

Run the code above in your browser using DataLab