MCMC convergence tests

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
francescob
Posts: 2
Joined: Wed Jan 03, 2018 11:41 am

MCMC convergence tests

Post 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

ChrisCharlton
Posts: 1193
Joined: Mon Oct 19, 2009 10:34 am

Re: MCMC convergence tests

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

francescob
Posts: 2
Joined: Wed Jan 03, 2018 11:41 am

Re: MCMC convergence tests

Post by francescob »

Thank you very much for your exhaustive and prompt reply.

Francesco

Post Reply