0

I'm running a glmer model with a three-way interaction, which causes me to receive the following warning:

Warning:
In optwrap(optimizer, devfun, start, rho$lower, control = control,  :
  convergence code 1 from nlminbwrap

The warning is not there when the 3-way interaction is omitted, so I suspect it has to do with model complexity.

Unfortunately, there is no further information about the nature of the convergence issue in the warning (and also not in the model summary), which makes it hard to resolve. [I've tried different optimizers and increasing the nr of function evaluations already].

Is there any way of finding out what precisely convergence code 1 means? Also, I'm wondering whether it is as serious as when it says Model failed to converge? I've been looking for an answer in the R help pages and in the GLMM FAQs, but can't seem to find any. Any help is much appreciated!

Elinguist
  • 65
  • 6
  • Can you post your model along with more information about your data? – sjp Jul 30 '20 at 21:40
  • Sure, the model is: model=glmer(Correct_or_incorrect~ (condition|CASE) + condition + sound + syll + condition:sound + condition:syll + syll:sound + condition:sound:syll, dataMelt, control=glmerControl(optimizer="nlminbwrap"), family = binomial) – Elinguist Jul 31 '20 at 12:00
  • Condition (4 levels), sound (2 levels) and syll (2 levels) are all within-subject factors, I have observations from 212 participants. I examined the correct identification (= 'Correct or incorrect') of 4 words (2 diff. syll levels, 2 diff. sound levels, full-factorial design) in 4 conditions (so 16 words in total). The melted dataframe therefore contained ~ 3400 observations. – Elinguist Jul 31 '20 at 12:05
  • (condition|CASE) is the by-subject rsl for condition. – Elinguist Jul 31 '20 at 12:08
  • You could plot the results based on various optimizers. If the results are consistent across optimizers, they would be more trustworthy. A function and a code-through is available at: https://pablobernabeu.github.io/2021/a-new-function-to-plot-convergence-diagnostics-from-lme4-allfit/ – Pablo Bernabeu Jun 24 '23 at 11:16

1 Answers1

0

Okay, so I've done some reading here with the hope of being able to help out a fellow linguist. Let's start with the model you specified in the comments:

model=glmer(Correct_or_incorrect~ (condition|CASE) + condition + sound + syll + condition:sound + condition:syll + syll:sound + condition:sound:syll, dataMelt, control=glmerControl(optimizer="nlminbwrap"), family = binomial)

The warning message code didn't say anything useful, but convergence code 1 from bobyqa at the very least used to be about exceeding the maximum number of function evaluations. How high did you try and go with the iterations? All you're going to lose is a few hours, so I would try and set it really high and see if the warning message goes away. All you'd be losing is computer time, and I personally think that's a small price to pay for a model that doesn't throw warnings.

You also mentioned that the warning was not there when the 3-way interaction is omitted, and I would be inclined to think that you are right concerning model complexity. If you don't have any specific hypotheses about that interaction I would leave it out and be done, but if you do, I think there are a few options that you haven't mentioned that you have tried yet.

There is a function called allFit() that will fit the model with all available optimizers. This would be a quick and easy way to see if your estimates are roughly the same among all the different optimizers. You run it on an already fitted model, like this:

allFit(model)

There is a good walkthough of using allFit() and it's different arguments here:https://joshua-nugent.github.io/allFit/ This page also has a lot of other potential solutions to your problem.

If you can, I would take advantage of a machine with multiple cores and run allFit with as many iterations as you can swing, and see if any of the optimizers don't give this warning, which is presumably about not minimizing the loss function before the iterations run out.

sjp
  • 820
  • 1
  • 5
  • 10
  • Hello fellow linguist :)! I'm sorry to only get back to your reply now, I was afk for the past 1.5 weeks. I used (maxfun=100000) and even that didn't help. In the meantime, I received a reply from a statistician via e-mail. He too suspects that the problem may be the three-way interaction and suggested to leave it out. As a matter of fact, I don't have a hypothesis about the interaction, and it's reassuring to hear from a fellow linguistics colleague that leaving it out seems like a good option :)! – Elinguist Aug 13 '20 at 15:49
  • I've actually tried the allFit() function already, and every available optimizer had a convergence error message. But I've never tried increasing the number of iterations there, so that might be something I can do in the future. In any case, thank you so much for having taken the time to reply and for your help with this matter - it is highly appreciated :). (And once again, sorry for the late answer.) – Elinguist Aug 13 '20 at 15:53
  • No problem, I'm happy to help. In Bodo Winter's new stats book, which I'll paste the citation for below, he specifically advocates for not including interactions when there are no principled reasons to include them. I know you've already talked with an actual statistician about it, but this could be useful as a citation backing up the decision from a linguist who is respected in terms of quantitative methods. Winter, B. (2019). Statistics for linguists: An introduction using R. Routledge. – sjp Aug 13 '20 at 16:49