Learn R Programming

BVAR (version 1.0.5)

logLik.bvar: Log-Likelihood method for Bayesian VARs

Description

Calculates the log-likelihood of Bayesian VAR models generated with bvar.

Usage

# S3 method for bvar
logLik(object, ...)

Value

Returns an object of class logLik.

Arguments

object

A bvar object, obtained from bvar.

...

Not used.

See Also

bvar

Examples

Run this code
# \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)

# Calculate the log-likelihood
logLik(x)
# }

Run the code above in your browser using DataLab