1
$\begingroup$

I run quite a few mixed models in lme4. I've found that fairly often models don't converge unless the predictors are centered.

I found online that convergence warnings can sometimes be resolved by centering, e.g. https://rstudio-pubs-static.s3.amazonaws.com/33653_57fc7b8e5d484c909b615d8633c01d51.html , but I don't understand why this is?

$\endgroup$

1 Answer 1

3
$\begingroup$

I doubt that centering your predictors will have much of an effect on convergence in itself. What may help in some cases is rescaling.

The combination of the two operations is usually called 'standardizing', and involves subtracting the overall mean from each value (centering) and dividing by the standard deviation (rescaling). This results in a variable that has mean zero and a variance/standard deviation of one.

The reason especially the second step can help with convergence is that a lot of the work in fitting a mixed model goes into calculations involving (co)variance matrices, or more accurately their inverse, the Hessian matrix of partial second derivatives. The optimizer iterates back and forth between estimating the random and fixed parts of your model until it reaches some numerical equilibrium. If your predictors exist on very different scales such covariance matrices are more likely to contain both very large and very small absolute values, which makes numerical operations such as inversion unstable. Keeping the scale of all values in these calculations similar makes the system more well-behaved.

It's not a panacea and will also depend on the model's algorithm/implementation, but it's also much easier to do than obtaining good starting values or actually start fiddling with the optimizer for example.

$\endgroup$
4
  • 1
    $\begingroup$ I would try and avoid standardizing. Frequently changing the unit (e.g., mm to m) helps already for convergence issues and you can still interpret model coefficients naturally and easily. $\endgroup$
    – Roland
    Feb 22 at 14:31
  • $\begingroup$ @Roland certainly, I'm not advocating for standardizing necessarily, only that it is the rescaling (standard or otherwise) rather than the shift that may improve convergence. If moving to another unit brings your variable closer in scale to the rest, that will have the same desired effect while better preserving the interpretation of the parameter estimates, but this is just another version of rescaling. $\endgroup$
    – PBulls
    Feb 22 at 19:03
  • $\begingroup$ Centering can sometimes help with convergence too. I usually encounter that with dates. $\endgroup$
    – Roland
    Feb 22 at 19:21
  • $\begingroup$ I do find that centering without scaling can often resolve convergence issues in my models. $\endgroup$
    – SilvaC
    Feb 26 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.