-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Algorithm did not converge #10
Comments
The iteration history suggests that your data have a flat (approximate) log-likelihood surface. This can be so because either you have too few clusters or to small clusters (I spuspect the latter). Maybe you try setting |
Hi Martin, Thanks for the response. I have a few questions:
I'm quite new to this type of analysis so apologies if these questions are basic. Regards, |
A log-likelihood function is flat if it does not have a maximum. This may occur e.g. when there is separation in logitistic regression. As a consequence, no maximum likelihood estimate exists. I write "(approximate)" because the (log-)likelihood function of logit models with random effects does not have a closed form. "Algorithm did not converge Fitted probabilities numerically 0 occurred" is a warning and not an error. Nevertheless I would not trust BICs here, because the log-likehood function is only a rough approximation. I suggested to set 'maxit=83' because this is the last iteration before the algorithm diverges. You may at least have finite (yet not very trustworthy) estimates then. It seems that indeed you do not have enough data to be able to estimate the random effects variance reliably. A quick fix would be to try fitting a multinomial model without random effects but with overdisperision. There may also a very slight chance that trying |
Hi Prof. Martin Elff,
I am trying to use your mblogit function to fit a multinomial logistic regression to examine the factors which predict participants in my experiment selecting one of three answers. Because my model is mixed (I am comparing different age groups of participants and also participants' performance on one of two trial types) I am including subject ID as a random factor.
For model selection, my approach is to start by fitting a full model (3 IVs with all their interactions) then removing components and comparing the BIC score of the model before and after removing each component. If removing a component dramatically reduces the BIC score (based on Raftery, 1995) then I will argue it does not add predictive value to the model and that component will not be included in the final model.
My problem here is that with the full model R studio returns the error "Algorithm does not converge". I increased the number of iterations to 200 but it returns the following issue:
Traceback() returns:
I then tried changing method to "MQL" but it gets to iteration 99 and returns this error:
Error in qr.default(x) : NA/NaN/Inf in foreign function call (arg 1)
Taking a few of the interactions out does remove this problem of convergence but if possible would like to get an estimate of the full model and all its interactions so I can report the BIC of this full model.
Do you know what I can do here to get the full model to run?
Thanks in advance!
Matthew
The text was updated successfully, but these errors were encountered: