Combine MCMC models

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN 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!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
vivian1234
Posts: 30
Joined: Tue Apr 12, 2016 10:54 am

Combine MCMC models

Post by vivian1234 »

Hi,

I would like to know if there is any way to combine the MCMC estimates from two models (same specification, only with different seeds)?
Let say I have MCMC.1 and MCMC.2 models, both of them are estimated by MCMC estimation (with 500000 iterations and burn-in = 5000) but using different random seeds. Can I "merge" the results to generate an average estimate across two models?

Thanks.

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

Re: Combine MCMC models

Post by ChrisCharlton »

If you request that R2MLwiN runs the models in parallel then this merging will happen automatically (see the last example in http://www.bristol.ac.uk/cmm/media/r2ml ... ide05.Rout).

If you are running the models separately then you will need to manually combine the values held in the output object. Depending on which information you are trying to extract you can do this by joining the chains using the coda package (https://cran.r-project.org/web/packages/coda/) and then summarising them or applying Ruben's rules to the point estimates. For an example of how R2MLwiN does then when running the models together see lines 2900 onward in https://github.com/rforge/r2mlwin/blob/ ... runMLwiN.R.
vivian1234
Posts: 30
Joined: Tue Apr 12, 2016 10:54 am

Re: Combine MCMC models

Post by vivian1234 »

Thanks! I will have a try.
Post Reply