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

dfmpost

Posterior Simulation for Dynamic Factor Models


Description

Produces draws from the posterior distributions of Bayesian dynamic factor models.

Usage

dfmpost(object)

Arguments

object

an object of class "dfmodel", usually, a result of a call to gen_dfm in combination with add_priors.

Details

The function implements the posterior simulation algorithm for Bayesian dynamic factor models.

The implementation follows the description in Chan et al. (2019) and C++ is used to reduce calculation time.

Value

An object of class "dfm".

References

Chan, J., Koop, G., Poirier, D. J., & Tobias J. L. (2019). Bayesian econometric methods (2nd ed.). Cambridge: Cambridge University Press.

Examples

# Load data
data("bem_dfmdata")

# Generate model data
model <- gen_dfm(x = bem_dfmdata, p = 1, n = 1,
                 iterations = 20, burnin = 10)
# Number of iterations and burnin should be much higher.

# Add prior specifications
model <- add_priors(model,
                    lambda = list(v_i = .01),
                    sigma_u = list(shape = 5, rate = 4),
                    a = list(v_i = .01),
                    sigma_v = list(shape = 5, rate = 4))

# Obtain posterior draws
object <- dfmpost(model)

bvartools

Bayesian Inference of Vector Autoregressive Models

v0.2.0
GPL (>= 2)
Authors
Franz X. Mohr [aut, cre]
Initial release
2021-04-25

We don't support your browser anymore

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