Multinomial: MCMC

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
KatrijnDelar
Posts: 11
Joined: Mon Aug 17, 2015 1:43 pm

Multinomial: MCMC

Post by KatrijnDelar »

Hi

I want to carry out a multinomial multilevel analysis in MlWin, using the Markov Chain Monte Carlo estimation procedure, but I'm having some difficulties.

When I switch from 1st order MQL to 2nd order PQL, I lose all my cases (while my data contains no missing values).
So, I tried to go straight to MCMC estimations, but then I get the following error:
"Error detected by MLN - MCMC error 0315: Prior variance matrix is not positive definite (MCMC 0 500 1 5.8 50 10 2 2 2 1 1 6).

I found a solution for this error on your website (http://www.bristol.ac.uk/cmm/software/s ... rrors.html).
However, having changed my variance matrix (see in attachment), I still get the same error.
Could anyone help me with this?

Many thanks,
Katrijn
Attachments
Variance Matrix.PNG
Variance Matrix.PNG (11.58 KiB) Viewed 21417 times
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Multinomial: MCMC

Post by ChrisCharlton »

Which version of MLwiN are you using, if it isn't 2.35 could you try with that and see if you get the same bahaviour?

After switching to MCMC could you press the "+" button at the bottom of the equations window to display the Priors, and check that these correspond to the covariances from the IGLS model?

Do you have a lot of variables (over 1000) in your data? If so then it's possible that they are stored in columns that MLwiN is expecting to use and may be confusing it.
KatrijnDelar
Posts: 11
Joined: Mon Aug 17, 2015 1:43 pm

Re: Multinomial: MCMC

Post by KatrijnDelar »

Dear Chris,

Thank you for your quick reply!

I'm using version 2.35, so that cannot be the problem...

I do not exactly understand what you mean, but I added a print screen of my priors (I couldn't see all the priors, but I guess they are all equal to 1).

And no, my dataset only contains 20 variables.

Kind regards,
Katrijn
Attachments
Priors_1.PNG
Priors_1.PNG (16.72 KiB) Viewed 21412 times
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Multinomial: MCMC

Post by ChrisCharlton »

Thanks for the additional information. The Priors I was interesting in seeing were the ones for the covariance matrices (for an example see the screenshot on page 76 of the MCMC guide: http://www.bristol.ac.uk/cmm/media/soft ... mc-web.pdf), as these should be the actual matrices that it is attempting to invert.
KatrijnDelar
Posts: 11
Joined: Mon Aug 17, 2015 1:43 pm

Re: Multinomial: MCMC

Post by KatrijnDelar »

Dear Chris,

I cannot scroll down to the bottom to see the priors for the covariance matrix (as I have 65 coefficients).
Is there another way to see them?

Many thanks,
Katrijn
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Multinomial: MCMC

Post by ChrisCharlton »

Two ways that I can think of are:
  • Use the Zoom option in the equations window to allow more of the equation to be visible.
  • Use the Model->MCMC->WinBUGS output menu to obtain a version of the model as a BUGS script, which should include these Priors.
KatrijnDelar
Posts: 11
Joined: Mon Aug 17, 2015 1:43 pm

Re: Multinomial: MCMC

Post by KatrijnDelar »

Dear Chris,

The zoom-function worked well.
As you can see, the covariance matrix is not similar to the covariances of the IGLS model
(especially the numbers I changed in column 1096).

Thanks,
Katrijn
Attachments
Covariance matrix.PNG
Covariance matrix.PNG (5.15 KiB) Viewed 21406 times
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Multinomial: MCMC

Post by ChrisCharlton »

If I remember correctly the values for these Priors are copied from the IGLS estimates at the point when you change the chosen estimation method from IGLS to MCMC. It is therefore possible that you changed the values after making the switch and therefore they weren't picked up. A solution to this would be to switch to IGLS and back to MCMC (you shouldn't need to re-run the model in between) and then check that the Priors contain the correct values.
KatrijnDelar
Posts: 11
Joined: Mon Aug 17, 2015 1:43 pm

Re: Multinomial: MCMC

Post by KatrijnDelar »

Dear Chris,

Thank you very much for your help!
It works!!!

Katrijn
Post Reply