# How many iterations are too many?

I have the following model:

 Model <- lmer(x ~ y * z * d * k + (1 + y * z + d | subject), data = Data,
REML = FALSE,
control = lmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000)))


It did not converge, should I increment the number of iterations? How many iterations are adequate?

• Convergence problems are not unusual if your model is quite complex (in particular regarding the random effects' structure). First you should make sure that you don't have a false convergence warning, see help("convergence"). Then you could try supplying better starting values to the optimizer. Ultimately, a simpler model is often the only solution if the data can't support the complex model. – Roland Sep 17 '19 at 12:36
• I tried with 1e+6 and it worked, no longer get a convergence warning. But are those too many iterations? – CatM Sep 17 '19 at 12:43
• @Roland: do you want to post your comments as an answer? – Stephan Kolassa Sep 17 '19 at 12:47
• The advice by @Roland is excellent. I would nevertheless be concerned about any results that required a million iterations to achieve, because that problem flags the very real possibility the solution could be a critical point but not optimal (or not even a true critical point at all). At a minimum you would want to capture diagnostic information during the iterations and explore that to see the details of the search. You would also want to apply standard reliability checks, including restarting the search from random locations. – whuber Sep 17 '19 at 12:52
• @CatM You should do that and also restart the fit from points slightly outside of the reported optimum. – Roland Sep 17 '19 at 12:59

You should use the methods described in help("convergence") to check that the warnings are not false positive and/or that you actually have achieved true convergence (arrived at a global maximum).