Learn R Programming

bayesGARCH (version 2.2.0)

formSmpl: Form the Posterior Sample

Description

Form the joint posterior sampler from the MCMC output.

Usage


  formSmpl(MCMC, l.bi = 0, batch.size = 1)

Value

The joint posterior sample as an mcmc object (R package coda).

Arguments

MCMC

object of the class mcmc.list (R package coda) or a list of matrices or a matrix. When several chains are given they must share the same number of rows and columns and the same column names.

l.bi

length of the burn-in phase, a whole number smaller than the chain length.

batch.size

batching size used to diminish the autocorrelation within the chains, a whole number greater or equal than one.

See Also

bayesGARCH for the Bayesian estimation of the GARCH(1,1) model with Student-t innovations.

Examples

Run this code
  ## !!! INCREASE THE NUMBER OF MCMC ITERATIONS !!!

  ## LOAD DATA SET
  data(dem2gbp)
  y <- dem2gbp[1:750]

  ## RUN THE ESTIMATION
  MCMC <- bayesGARCH(y, control = list(n.chain = 2, l.chain = 100))

  ## FORM THE SAMPLE FROM THE MCMC OUTPUT
  smpl <- formSmpl(MCMC, l.bi = 50, batch.size = 2)

  ## POSTERIOR STATISTICS
  summary(smpl)

Run the code above in your browser using DataLab