Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

augment.bvar

Augment BVAR outputs and convert into a tibble


Description

Turn the outputs of a Bayesian VAR (see bvar) into a an augmented tibble. Methods are available for bvar objects (will yield coefficients and their quantiles), bvar_fcast objects (with predictions, their quantiles and optionally real datapoints), and bvar_irf objects (with impulse responses).

Usage

## S3 method for class 'bvar'
augment(x, conf_bands = 0.16, ...)

## S3 method for class 'bvar_fcast'
augment(x, t_back = 0L, ...)

## S3 method for class 'bvar_irf'
augment(x, ...)

Arguments

x

A bvar or derived object to turn into a tibble.

conf_bands

Numeric vector. Credible intervals of coefficients to include in the tibble.

...

Not used.

t_back

Integer scalar. Whether to include actual datapoints in the tidied forecast.

Value

Returns a tibble with relevant information; quantiles can be found in the columns.

Examples

# Access a subset of the fred_qd dataset
data <- fred_qd[, c("CPIAUCSL", "UNRATE", "FEDFUNDS")]
# Transform it to be stationary
data <- fred_transform(data, codes = c(5, 5, 1), lag = 4)

# Estimate a BVAR using one lag, default settings and very few draws
x <- bvar(data, lags = 1, n_draw = 1000L, n_burn = 200L, verbose = FALSE)

# Create tibbles from the outputs
augment(x)
augment(irf(x))
augment(predict(x))

BVARverse

Tidy Bayesian Vector Autoregression

v0.0.1
GPL-3
Authors
Lukas Vashold [aut, cre] (<https://orcid.org/0000-0002-3562-3414>), Nikolas Kuschnig [aut] (<https://orcid.org/0000-0002-6642-2543>)
Initial release
2020-09-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.