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.
# 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, ...)
A bvar
object, obtained from bvar
.
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.
Logical scalar. Whether to retrieve the companion matrix of
coefficients. See companion.bvar
.
Not used.
Object of class bvar_coefs
or bvar_vcovs
.
Integer scalar. Fed to round
and applied
to numeric outputs (i.e. the quantiles).
Logical scalar. Whether to print only medians or all available confidence bands.
Returns a numeric array of class bvar_coefs
/
bvar_vcovs
with desired values at the specified confidence bands.
# 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