Learn R Programming

bvartools (version 0.2.4)

thin.bvar: Thinning Posterior Draws

Description

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

Usage

# S3 method for bvar
thin(x, thin = 10, ...)

Value

An object of class "bvar".

Arguments

x

an object of class "bvar".

thin

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

...

further arguments passed to or from other methods.

Examples

Run this code

# Load data
data("e1")
e1 <- diff(log(e1)) * 100

# Obtain data matrices
model <- gen_var(e1, p = 2, deterministic = 2,
                 iterations = 100, burnin = 10)
# Chosen number of iterations and burn-in draws should be much higher.

# Add prior specifications
model <- add_priors(model)

# Obtain posterior draws
object <- draw_posterior(model)

object <- thin(object)

Run the code above in your browser using DataLab