Page 1 of 1

Error fitting Multinomial logit using PQL2

Posted: Mon Jun 18, 2012 5:45 am
by jmflavel
Hello
I ran a 2 level multinomial logit using MQL and then tried to fit it using PQL2 but keep receiving an error message.

My syntax is set out as follows:

Code: Select all

runmlwin depvar varlist, level2(id:cons) level1(tpid) discrete(distribution(multinomial) link(mlogit) denominator(cons) basecategory(2)) maxiterations(100) nopause

Code: Select all

runmlwin depvar varlist, level2(id:cons) level1(tpid) discrete(distribution(multinomial) link(mlogit) denominator(cons) basecategory(2) pql2) maxiterations(100) initsprevious nopause
The first line runs successfully but the second does not. It comes back with an error saying that WARNING: IGLS algorithm failed to converge. Increase the number of iterations. See the maxiterations() option.

When I check the output it says only 6 iterations were run even though I set maxiterations at 100. Can anybody please advise where I have gone wrong?
Thanks

Re: Error fitting Multinomial logit using PQL2

Posted: Mon Jun 18, 2012 4:36 pm
by ChrisCharlton
I would suggest running the command again, but without the nopause option so that you can check what's in the equations window. It's possible that one or more of the results have gone to an invalid number, such as infinity.

Re: Error fitting Multinomial logit using PQL2

Posted: Tue Jun 19, 2012 8:03 am
by GeorgeLeckie
Hi,

You have used the initsprevious option to use the MQL1 estimates for your model as starting values for fitting the model by PQL2. This is sensible as it cuts down on convergence issues.

Another way to cut down on convergence issues is to build up the model gradually. Fit a simple model, then add some more covariates and refit using the estimates from the previous model as starting values for the current model. This is particularly important in models with complex random parts.

Best wishes

George

Re: Error fitting Multinomial logit using PQL2

Posted: Sun Jun 24, 2012 4:25 am
by jmflavel
Thank you both for your replies. I have followed both of your suggestions. I was able to get estimates fitted using PQL2 when I omitted the nopause option but I cannot get results within Stata using runmlwin, I can only get them from within MLwiN. There is very little difference between the MQL1 and PQL2 results

I also ran into a new problem. The next extension of my model (after fitting using PQL2) was to fit it using MCMC. I have not been able to successfully do this. I tried to run it within MLwiN following PQL2 but received error messages, firstly that it could not run without NOPAUSE-I think the message said something about OBEY, then a second error message said it couldn't run because the prior variance matrix was not positive definite

I am in the process of running the same model using gllamm in Stata but was hoping to get results using MLwiN for comparison. I did read this past post where George gave some very useful advice

http://www.cmm.bristol.ac.uk/forum/view ... ?f=3&t=270

I will have to go and do some investigating but just wanted to post my thanks for your responses

Re: Error fitting Multinomial logit using PQL2

Posted: Mon Jun 25, 2012 5:25 pm
by GeorgeLeckie
Hi Jurjen,

You say
I was able to get estimates fitted using PQL2 when I omitted the nopause option but I cannot get results within Stata using runmlwin, I can only get them from within MLwiN.
This sounds strange. If you can fit the model using PQL2 when you use the nopause option then the results should be returned to Stata when you click the "Resume Macro" button for the second time. What happens when you click the "Resume Macro" button for the second time?

You say
The next extension of my model (after fitting using PQL2) was to fit it using MCMC.
The MQL1 estimates are normally good enough starting values for MCMC, so no need to get PQL2 estimates for this purpose.

You say that you get the following error message
the prior variance matrix was not positive definite
You typically get this message when you provide nonsensical starting values for the MCMC chain. For example negative variances or when the model includes random coefficients, correlations which do not lie in the range -1 to +1. This might happen if the model you have fitted by MQL1/PQL2 has had convergence difficulties and has given nonsensical estimates. Check that the starting values you are providing are sensible

Best wishes

George

Re: Error fitting Multinomial logit using PQL2

Posted: Sat Jun 30, 2012 2:04 am
by jmflavel
Thanks George. I was able to run mcmc using MQL1 results as starting values. I did check for nonsensical values first but the starting values look quite reasonable. I'm not sure why
i was having difficulty before but am grateful for your advice which has helped solve my problem

Thanks again

Regards
Joanne

Re: Error fitting Multinomial logit using PQL2

Posted: Thu Jul 05, 2012 5:14 pm
by GeorgeLeckie
That's good news, I'm glad runmlwin is working for you again
George