Page 1 of 1

mcmc model stops running

Posted: Tue Sep 07, 2021 5:43 pm
by med151991
Hello,

So my code worked with running this

Code: Select all

model<-log(death)~1+gender+education+parentdeath+offset(log(personyears))+(1|region)+(1|household)
model1<-runMLwiN(Formula=model, D="Poisson", data=dataset, estoptions=list(EstM=1))
however, when I add the iterations and burn in, it says 'MLwiN is running please wait' for a while, then just stops completely with no warning messages or any return.

Code: Select all

model<-log(death)~1+gender+offset(log(personyears))+(1|region)+(1|household)
model1<runMLwiN(Formula=model, D="Poisson", data=dataset, estoptions=list(EstM=1), mcmcMeth=list(burnin=500, nchains=2, iterations=2500, thinning=10)))
There are a lot of cases so I am wondering if its too complex, but it work with the first type of mcmc code so I'm not sure

Re: mcmc model stops running

Posted: Wed Sep 08, 2021 9:01 am
by ChrisCharlton
When you specify more than one chain in R2MLwiN each estimated chain is sent to a child R process so that they can be run in parallel. This can result in status messages not being sent back to the main R instance for display. You can check whether this is the cause by temporarily changing nchains back to 1 and looking for messages as the model runs. You can also check that the model is set up correctly by adding the debugmode=TRUE options in estoptions. This will cause the model to open in the GUI version of MLwiN, pausing before and after the model fitted.

One possible reason why nothing is returned for your second model is that you have a less than (<), rather than an assignment (<-) on the last line. If this is your actual syntax then anything that comes back from the runMLwiN function will be thrown away.

Re: mcmc model stops running

Posted: Wed Sep 08, 2021 12:39 pm
by med151991
Hi Chris,

You are right thank you, i didn't notice that it had finished, I had used multiple chains so that makes sense thank you. The < was a mistake in writing out the code I used. Thanks for your help and quick reply!