rbayesianmcmcwinbugsr2winbugs

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


Solution

  • 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.