I am running JAGS in parallel, i.e. each chain in separate process/thread. I am calling run.jags(..., method = "rjparallel", params = c(..., "dic", "ped")). I get the following error:
jags The DIC, PED, pD, full.pD and pOpt cannot be assessed when using parallel or separate chains
Hmmm....
Is it because DIC and PED are computed from all the chains, not just one? Couldn't it be done in the
run.jagsfunction after collecting the results from all of the threads?Is there any way around that? How can I get DIC and PED while having parallel run? It must be possible somehow, right?
If you are running the model in parallel you cannot track
dicorped. The reason for this is that theextend.jagsfunction requires "...multiple chains WITHIN the same simulation" (emphasis added, see help file and look up themonitorarguments for theextend.jagsfunction). When running in parallel you only have a single chain per core.However, you can collect these AFTER you have fit the model with the
extractfunction. Here is a reproducible example of a simple JAGS model to illustrate how to do this.