I typically call JAGS from rjags with several chains for diagnostic purposes (e.g., 4 chains). After that I often want to do some post processing on the posterior parameter estimates (e.g., use predicted values, compute additional statistics). However, at this point it is a nuisance having the chains stored in a list.
What's a good way to combine the chains into a single parameter list?
The runjags
package has the function combine.mcmc
. Its default setting is to combine one or more chains and return a single chain. E.g.,
library(runjags)
fit <- combine.mcmc(multichainfit)
It also has other options for combining chains.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With