Sedat
Sedat

Reputation: 25

How can I convert OpenBUGS Coda file to mcmc object in R?

I used OpenBUGS and it produced coda files of MCMC output. To calculate and plot Gelman Rubin and Geweke diagnostics, I need to convert this coda.odc file to a mcmc object in R? Is there any way to do this? Or do you recommend me some other way(s) to do this analysis?

Thanks

Upvotes: 1

Views: 878

Answers (1)

guyabel
guyabel

Reputation: 8366

Ues read.coda in the coda package,... something like:

library(coda)
my.coda <- read.coda("Chain1.txt", "CODAIndex.txt")

Might work with .odc files. Defiantly works if you save the CODA files as .txt from OpenBUGS The my.coda will be a mcmc type object.

Upvotes: 1

Related Questions