LMM Convergence Issue in Jamovi 2.6.44.0 with GAMLj3

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
AnnaPiccolo
Posts: 2
Joined: Mon Mar 24, 2025 12:46 pm

LMM Convergence Issue in Jamovi 2.6.44.0 with GAMLj3

Post by AnnaPiccolo »

I have created a linear mixed model (LMM) in Jamovi 2.6.44.0 using GAMLj3. I have defined Variable A as the dependent variable, Time as a factor, and Subject ID as the cluster variable. The full model includes fixed slopes and intercepts, as well as random slopes and intercepts with an autoregressive (AR) residual structure. Additionally, I have defined a nested model with fixed slopes and intercepts, and a random intercept. I activated model comparison to assess significant differences in model fit between the full and nested models.

However, the model consistently fails to reach convergence, showing the following error message: “! Argument is of length zero.” I have tried running the same model in R, where it successfully converges. I would like to understand why it fails to converge in Jamovi, as I would prefer to use it instead of R.

I have 122 subjects over three time points, with no missing data. I am open to sharing data.
User avatar
mcfanda@gmail.com
Posts: 549
Joined: Thu Mar 23, 2017 9:24 pm

Re: LMM Convergence Issue in Jamovi 2.6.44.0 with GAMLj3

Post by mcfanda@gmail.com »

Can you share an example?
AnnaPiccolo
Posts: 2
Joined: Mon Mar 24, 2025 12:46 pm

Re: LMM Convergence Issue in Jamovi 2.6.44.0 with GAMLj3

Post by AnnaPiccolo »

In what form would you prefer it? Here I attach the screenshot of the model specification and output.
Screenshot 2025-03-26 093528.png
Screenshot 2025-03-26 093528.png (172.75 KiB) Viewed 28116 times
User avatar
mcfanda@gmail.com
Posts: 549
Joined: Thu Mar 23, 2017 9:24 pm

Re: LMM Convergence Issue in Jamovi 2.6.44.0 with GAMLj3

Post by mcfanda@gmail.com »

Hi
I meant a omv file, so we can check what the issue is
Thanks
User avatar
mcfanda@gmail.com
Posts: 549
Joined: Thu Mar 23, 2017 9:24 pm

Re: LMM Convergence Issue in Jamovi 2.6.44.0 with GAMLj3

Post by mcfanda@gmail.com »

Hi
well, there are several issues here, some of them are not easy to solve. First, the jamovi error "argument is of length zero" should not appear, so we'll fix it as soon as I can see an omv file (I cannot reproduce the error on similar data). However, it is not related with model convergence.

The main issue here is that your model is not identified. There are exactly the same number of data points as there are parameters to be estimated. Indeed, it seems you have 366 data points, and you estimate 3 (1 intercept and 2 effects) coefficients per participants (122), which makes 366 coefficients.

For these models, the random component is likely unidentifiable, meaning that the random variances and the residual variance gets mixed up and the solution is not unique. Roughly speaking, the random component estimates are likely to be unreliable.

Now the issue is that different software behaves (by default) in different ways for these models, and thus you get different results across software. GAMLj3 also behaves differently depending on the way the model is defined.

If one uses "Residual Structure = identity" (the default), GAMLj3 uses R package lme4::lmer() default, and does not estimate the model. You get an error saying that the "number of observations <= number of random effects".

If one selects any other type of residual variance structure, GAMLj3 uses nlme::lme() defaults, and tries to estimate the model anyway. That is likely the reason you said the model converges when estimated in R. Results are produced, even if the model is unidentified. As in nlme::lme(), you get no warning and one thinks the model "converged" , which indeed it did, but the results are likely to be partly untrustworthy (we will issue a warning in this case in next versions of gamlj3).

Which behavior is correct is debatable. lme4::lmer() is more cautious, and requires the user to explicitly force the module to estimate a (partly) unidentified model (with the option 'check.nobs.vs.nRE = "ignore"'. nlme::lme() just searches for a solution, and leaves it to the user to make sense of it. Nonetheless, whatever is the software one uses, the model is still unidentified (at least some of its estimates).

What to do in practice is again open to debate. The standard approach is to remove the random effect of time (you still have AR structure to capture dependency over time). But there might be scholars who disagree.
Post Reply