Learn R Programming

bayesianVARs (version 0.1.8)

vcov.bayesianVARs_bvar: Extract posterior draws of the (time-varying) variance-covariance matrix for a VAR model

Description

Returns the posterior draws of the possibly time-varying variance-covariance matrix of a VAR estimated via bvar(). Returns the full paths if sv_keep="all" when calling bvar(). Otherwise, the draws of the variance-covariance matrix for the last observation are returned, only.

Usage

# S3 method for bayesianVARs_bvar
vcov(object, t = seq_len(nrow(object$logvar)), ...)

Value

An array of class bayesianVARs_draws of dimension \(T \times M \times M \times draws\), where \(T\) is the number of observations, \(M\) the number of time-series and \(draws\) the number of stored posterior draws.

Arguments

object

An object of class bayesianVARs_bvar obtained via bvar().

t

Vector indicating which points in time should be extracted, defaults to all.

...

Currently ignored.

See Also

summary.bayesianVARs_draws, coef.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 the variance-covariance matrix
bvar_vcov <- vcov(mod)

Run the code above in your browser using DataLab