# glmer inverse Gaussian distribution and identity link, some models failed to converge

I'm relatively new to GLMM and am experiencing some difficulty with model convergence. Specifically, I have a data set from 200+ participants, each of whom completed 200 trials of a visual search task. I'm trying to examine whether their RTs changed as functions of trials (from the 1st trial to the 200th trial, centered at the midpoint), two categorical variables (coded as -0.5/0.5), and their interactions.

I followed Lo & Andrews' (2015) recommendation to use a series of generalized liner mixed model with a inverse-Gaussian distribution and an identity link to account for the fact that RT data are positively skewed.

However, as I started building my models, the simplest model: glm0<-glmer(RT~cent_trial+(1|subject),final.dat,family=inverse.gaussian(link="identity)) gave me these two errors:

1: In checkConv(attr(opt, "derivs"), opt$$par, ctrl = control$$checkConv,  :
Model failed to converge with max|grad| = 0.379158 (tol = 0.002, component 1)
2: In checkConv(attr(opt, "derivs"), opt$$par, ctrl = control$$checkConv,  :
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?



Results from the simplest model:

 Family: inverse.gaussian  ( identity )
Formula: RT ~ cent_trial + (1 | subject)
Data: final.dat

AIC       BIC    logLik  deviance  df.resid
747885.4  747920.2 -373938.7  747877.4     45142

Scaled residuals:
Min      1Q  Median      3Q     Max
-2.1138 -0.6113 -0.2174  0.3410 29.8407

Random effects:
Groups   Name        Variance  Std.Dev.
subject  (Intercept) 1.886e+05 4.343e+02
Residual             6.591e-05 8.119e-03
Number of obs: 45146, groups:  subject, 240

Fixed effects:
Estimate Std. Error  t value Pr(>|z|)
(Intercept)  3.851e+03  1.865e-04 20652053   <2e-16 ***
cent_trial  -4.726e+00  1.865e-04   -25344   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
(Intr)
cent_trial 0.000
optimizer (Nelder_Mead) convergence code: 0 (OK)
Model failed to converge with max|grad| = 0.379158 (tol = 0.002, component 1)
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?


Though, as I added more predictors to the model: glm2<-glmer(RT~cent_trial+Feedback+Prevalence+(1|subject),final.dat,family=inverse.gaussian(link="identity")) these error messages disappeared.

Results from the model above:

 Family: inverse.gaussian  ( identity )
Formula: RT ~ cent_trial + Feedback + Prevalence + (1 | subject)
Data: final.dat

AIC       BIC    logLik  deviance  df.resid
747880.2  747932.5 -373934.1  747868.2     45140

Scaled residuals:
Min      1Q  Median      3Q     Max
-2.1117 -0.6099 -0.2159  0.3418 29.6671

Random effects:
Groups   Name        Variance  Std.Dev.
subject  (Intercept) 1.771e+05 4.208e+02
Residual             6.603e-05 8.126e-03
Number of obs: 45146, groups:  subject, 240

Fixed effects:
Estimate Std. Error t value Pr(>|z|)
(Intercept) 3773.44197    3.86486  976.35   <2e-16 ***
cent_trial    -4.72718    0.06793  -69.59   <2e-16 ***
Feedback    -377.67642    4.37414  -86.34   <2e-16 ***
Prevalence   533.15690    4.68888  113.71   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
(Intr) cnt_tr Fedbck
cent_trial -0.003
Feedback   -0.128  0.001
Prevalence -0.127  0.000 -0.094


I tried to add more iterations or use a different optimizer, but they did not seem to resolve this issue. I wonder what's causing it?

• Hi @Mellowbook249, welcome to CV. The message says "Rescale variables?" - have you tried that? does this link help too? stats.stackexchange.com/questions/164457/… Jul 26, 2023 at 1:25
• Hi @Alex J, can you be more specific about which variable may need to be rescaled? My DV (RT) was measured in milliseconds, trials are from 1 to 200 (and have been centered to the midpoint, e.g., -99, -98, ... 99), and the other categorical variables are just coded as -0.5/0.5. Thanks for your help! Jul 26, 2023 at 1:42
• I don't know because I can't see the data. However, if you look at the size of your parameter estimates in the output, they are massive. The suggestion of scaling and centering was applied to all variables in the top-rated answer in my link - from your description, probably it's the DV that needs to be rescaled. Jul 26, 2023 at 1:52
• Something else you might want to try: a different link function. Is there a particular reason you have chosen the identity link? Because the mean of an I.G. distribution is positive, but an identity link spans $-\infty,\infty$, it might not be appropriate. Maybe try a log link? Jul 26, 2023 at 1:54
• Following your recommendation, I did try rescaling trials, and the model successfully converged. Now, I'm just confused as to how to interpret the coefficients. Originally, the interpretation for trials would be: for every trial increase, their RT decreases by xx seconds, but now that trials have been scaled, what would be the correct interpretation? I used an identity link because it was recommended by the source I included in my original post. If I opt to use the log link, would it change the interpretation of RT? Thanks! Jul 26, 2023 at 2:03