Last chance! 50% off unlimited learning
Sale ends in
Calculates the companion matrix for Bayesian VARs generated via
bvar
.
# S3 method for bvar
companion(object, conf_bands = 0.5, complete = FALSE,
...)companion(object, ...)
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 value. Whether to retrieve the companion matrix for
all saved draws of the VAR coefficients. Overrides conf_bands
if set
TRUE
.
Not used.
Returns a numeric array/matrix of class bvar_comp
with the
VAR's coefficents in companion form, at the specified confidence bands.
# NOT RUN {
data <- matrix(rnorm(200), ncol = 2)
x <- bvar(data, lags = 2)
# Get companion matrices for confidence bands at to 10%, 50% and 90%
companion(x, conf_bands = 0.10, complete = FALSE)
# Get companion matrices for all draws of the VAR coefficients
companion(x, complete = TRUE)
# }
Run the code above in your browser using DataLab