Convergence
The challenge of convergence is well known in the area of mixed-effects models. These models often struggle to reach reliable-enough estimates due to an insufficiency of data relative to the complexity of the model (Baayen et al., 2008; Bates et al., 2015; Brauer & Curtin, 2018). The solutions proposed range from the removal of random slopes under certain conditions (Matuschek et al., 2017) to the maintenance of random slopes in spite of convergence warnings, which seeks to avoid an inflation of the Type I error due to dependencies in the data (Brauer & Curtin, 2018; Singmann & Kellen, 2019).
The multiple-optimisers sanity check from lme4::allFit()
Framed within the drive to maintain random slopes wherever possible, the developers of the ‘lme4’ package propose a sanity check that uses a part of the ‘lme4’ engine called ‘optimiser’. Every model has a default optimiser, unless a specific one is chosen through control = lmerControl(optimiser = '...')
(in lmer
models) or control = glmerControl(optimiser = '...')
(in glmer
models). The seven widely-available optimisers are:
- bobyqa
- Nelder_Mead
- nlminbwrap
- nmkbw
- optimx.L-BFGS-B
- nloptwrap.NLOPT_LN_NELDERMEAD
- nloptwrap.NLOPT_LN_BOBYQA
To assess whether convergence warnings render the results invalid, or on the contrary, the results can be deemed valid in spite of the warnings, Bates et al. (2021) suggest refitting models affected by convergence warnings with a variety of optimisers. The authors argue that if the different optimisers produce practically-equivalent results, the results are valid. For this purpose, the ‘allFit’ function from the ‘lme4’ package allows the refitting of models using a number of optimisers. To use the seven optimisers listed above, two extra packages were installed: ‘dfoptim’ and ‘optimx’ (see lme4 manual). The output from ‘allFit’ contains several statistics on the fixed and the random effects fitted by each optimiser (see example).
The severity of convergence problems in each study will be examined below using the ‘allFit’ function from the ‘lme4’ package.
References
Thesis: https://doi.org/10.17635/lancaster/thesis/1795.
Online book created using the R package bookdown.