# \donttest{
# 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)
# Get densities of the hyperparameters
density(x)
# Plot them
plot(density(x))
# Only get the densities associated with dependent variable 1
density(x, vars_response = "CPI")
# Check out the constant's densities
plot(density(x, vars_impulse = 1))
# Get the densities of variable three's first lag
density(x, vars = "FEDFUNDS-lag1")
# Get densities of lambda and the coefficients of dependent variable 2
density(x, vars = c("lambda", "UNRATE"))
# }
Run the code above in your browser using DataLab