Page 1 of 1

MCMC convergence tests

Posted: Wed Jan 03, 2018 11:57 am
by francescob
Hello,

I just have one simple question. I presume Bill would be the expert in this area.
Currently Is there any way of performing MCMC convergence tests such as Geweke or Gelman & Rubin's test in MLwiN?

Thank you very much,

Francesco

Re: MCMC convergence tests

Posted: Wed Jan 03, 2018 12:17 pm
by ChrisCharlton
If you open the Model->Trajectories window and click on one of the parameters then you will be offered the option to calculate MCMC diagnostics for the chosen parameter (these diagnostics are first described in section 3.1 of the MCMC guide - http://www.bristol.ac.uk/cmm/software/m ... nuals.html). Some convergence diagnostics are included in these, although not the specific ones that you mention. As the chains are available you could extract these and perform the Geweke test manually, however the easier option would be to call MLwiN from within R using the R2MLwiN http://www.bristol.ac.uk/cmm/software/r2mlwin/ package as this would then allow you to use the R coda package https://cran.r-project.org/web/packages/coda/ which includes the function geweke.diag() to perform this test. The Gelman and Rubin test requires you to run multiple chains, so to perform this test within MLwiN you would need to run the model multiple times with different starting values and/or seeds, copying the chains to a spare column each time. Once you have several chains you can use the BGRD command to calculate the relevant statistics. It would however again be easier to run the multiple chains via R2MLwiN as this supports them directly and then using the gelman.diag() function to perform the test.

Re: MCMC convergence tests

Posted: Wed Jan 03, 2018 3:00 pm
by francescob
Thank you very much for your exhaustive and prompt reply.

Francesco