draw_posterior.bvecmodel: Posterior Simulation for Vector Error Correction Models

View source: R/draw_posterior.bvecmodel.R

draw_posterior.bvecmodelR Documentation

Posterior Simulation for Vector Error Correction Models

Description

Forwards model input to posterior simulation functions for vector error correction models.

Usage

## S3 method for class 'bvecmodel'
draw_posterior(object, FUN = NULL, mc.cores = NULL, ...)

Arguments

object

a list of model specifications, which should be passed on to function FUN. Usually, the output of a call to gen_vec in combination with add_priors.

FUN

the function to be applied to each list element in argument object. If NULL (default), the internal function bvecpost is used.

mc.cores

the number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized from environment variable MC_CORES if set. Must be at least one, and parallelization requires at least two cores.

...

further arguments passed to or from other methods.

Value

For multiple models a list of objects of class bvarlist. For a single model the object has the class of the output of the applied posterior simulation function. In case the package's own functions are used, this will be "bvec".

References

Koop, G., León-González, R., & Strachan R. W. (2010). Efficient posterior simulation for cointegrated models with priors on the cointegration space. Econometric Reviews, 29(2), 224–242. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07474930903382208")}

Koop, G., León-González, R., & Strachan R. W. (2011). Bayesian inference in a time varying cointegration model. Journal of Econometrics, 165(2), 210–220. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2011.07.007")}

Examples


# Load data 
data("e6")
e6 <- e6 * 100

# Generate model
model <- gen_vec(e6, p = 1, r = 1, const = "restricted",
                 iterations = 10, burnin = 10)
# Chosen number of iterations and burn-in should be much higher.

# Add priors
model <- add_priors(model)

# Obtain posterior draws
object <- draw_posterior(model)


bvartools documentation built on Aug. 31, 2023, 1:09 a.m.