Learn R Programming

R2jags (version 0.8-9)

jags2bugs: Read jags output files in CODA format

Description

This function reads Markov Chain Monte Carlo output in the CODA format produced by jags and returns an object of class mcmc.list for further output analysis using the coda package.

Usage

jags2bugs(path=getwd(), parameters.to.save, 
  n.chains=3, n.iter=2000, n.burnin=1000, n.thin=2,
  DIC=TRUE)

Arguments

path

sets working directory during execution of this function; This should be the directory where CODA files are.

parameters.to.save

character vector of the names of the parameters to save which should be monitored.

n.chains

number of Markov chains (default: 3)

n.iter

number of total iterations per chain (including burn in; default: 2000)

n.burnin

length of burn in, i.e. number of iterations to discard at the beginning. Default is n.iter/2, that is, discarding the first half of the simulations.

n.thin

thinning rate, default is 2

DIC

logical; if TRUE (default), compute deviance, pD, and DIC. The rule pD=var(deviance) / 2 is used.

Author

Yu-Sung Su suyusung@tsinghua.edu.cn, Masanao Yajima yajima@stat.columbia.edu