thin.dfm: Thinning Posterior Draws

View source: R/thin.dfm.R

thin.dfmR Documentation

Thinning Posterior Draws

Description

Thins the MCMC posterior draws in an object of class "dfm".

Usage

## S3 method for class 'dfm'
thin(x, thin = 10, ...)

Arguments

x

an object of class "dfm".

thin

an integer specifying the thinning interval between successive values of posterior draws.

...

further arguments passed to or from other methods.

Value

An object of class "dfm".

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 <- draw_posterior(model)

# Plot factors
object <- thin(object, thin = 2)


franzmohr/bvartools documentation built on Jan. 28, 2024, 4:06 a.m.