Learn R Programming

BVAR (version 0.2.2)

coef.bvar: Coefficient and VCOV methods for Bayesian VARs

Description

Retrieves coefficient / variance-covariance values for Bayesian VARs generated with bvar. Note that coefficients are available for every stored draw and credible intervals may be set via the conf_bands argument.

Usage

# S3 method for bvar
coef(object, conf_bands = 0.5, companion = FALSE, ...)

# S3 method for bvar vcov(object, conf_bands = 0.5, ...)

# S3 method for bvar_coefs print(x, digits = 3L, complete = FALSE, ...)

# S3 method for bvar_vcovs print(x, digits = 3L, complete = FALSE, ...)

Arguments

object

A bvar object, obtained from bvar.

conf_bands

Numeric vector of desired confidence bands to apply. E.g. for bands at 5%, 10%, 90% and 95% set this to c(0.05, 0.1). Note that the median, i.e. 0.5 is always included.

companion

Logical scalar. Whether to retrieve the companion matrix of coefficients. See companion.bvar.

...

Not used.

x

Object of class bvar_coefs or bvar_vcovs.

digits

Integer scalar. Fed to round and applied to numeric outputs (i.e. the quantiles).

complete

Logical scalar. Whether to print only medians or all available confidence bands.

Value

Returns a numeric array of class bvar_coefs / bvar_vcovs with desired values at the specified confidence bands.

See Also

bvar; companion.bvar

Examples

Run this code
# NOT RUN {
data <- matrix(rnorm(200), ncol = 2)
x <- bvar(data, lags = 2)

# Get coefficent values at the 10%, 50% and 90% quantiles
coef(x, conf_bands = 0.10)

# Only get the median of the variance-covariance matrix
vcov(x, conf_bands = 0.5)
# }

Run the code above in your browser using DataLab