NaN confidence intervals for random effects generalized mixed effect model fitglme()

20 views (last 30 days)
Ali on 5 Jun 2020
Answered: Paul on 5 Aug 2020
Hi,
I use the following line to fit a generalized linear mixed effect model on my data:
glme = fitglme(tbl, 'error ~ 1 + var1*var2 + (1+ var1*var2 | subject)', ...
'DummyVarCoding','effects')
Here is the results:
glme =
Generalized linear mixed-effects model fit by ML
Model information:
Number of observations 125388
Fixed effects coefficients 4
Random effects coefficients 72
Covariance parameters 10
Distribution Binomial
FitMethod Laplace
Formula:
error ~ 1 + va1*var2 + (1 + var1*var2 | subject)
Model fit statistics:
AIC BIC LogLikelihood Deviance
67909 68045 -33941 67881
Fixed effects coefficients (95% CIs):
Name Estimate SE tStat DF pValue Lower Upper
{'(Intercept)'} 1.4242 0.24318 5.8564 1.2538e+05 4.7419e-09 0.94755 1.9008
{'var1' } 0.071231 0.0055598 12.812 1.2538e+05 1.4861e-37 0.060334 0.082128
{'var2' } -0.12883 0.013019 -9.8958 1.2538e+05 4.4287e-23 -0.15435 -0.10332
{'var1:var2' } 0.0023277 0.00042286 5.5046 1.2538e+05 3.7072e-08 0.0014989 0.0031565
Random effects covariance parameters:
Group: subject (18 Levels)
Name1 Name2 Type Estimate
{'(Intercept)'} {'(Intercept)'} {'std' } 1.0232
{'var1' } {'(Intercept)'} {'corr'} 0.38145
{'var2' } {'(Intercept)'} {'corr'} -0.43246
{'var1:var2' } {'(Intercept)'} {'corr'} 0.25889
{'var1' } {'var1' } {'std' } 0.019984
{'var2' } {'var1' } {'corr'} -0.15137
{'var1:var2' } {'var1' } {'corr'} 0.63492
{'var2' } {'var2' } {'std' } 0.052801
{'var1:var2' } {'var2' } {'corr'} 0.59288
{'var1:var2' } {'var1:var2' } {'std' } 0.0013593
Group: Error
Name Estimate
{'sqrt(Dispersion)'} 1
Then I use the following to get 95% confidence intervals for random effects:
[psi,dispersion,stats] = covarianceParameters(glme);
When I look at the confidence intervals, I have some NaN values:
stats{1}
ans =
Covariance Type: FullCholesky
Group Name1 Name2 Type Estimate Lower Upper
subject {'(Intercept)'} {'(Intercept)'} {'std' } 1.0232 0.74346 1.4083
subject {'var1' } {'(Intercept)'} {'corr'} 0.38145 NaN NaN
subject {'var2' } {'(Intercept)'} {'corr'} -0.43246 -0.44369 -0.42108
subject {'var1:var2' } {'(Intercept)'} {'corr'} 0.25889 0.10277 0.40256
subject {'var1' } {'var1' } {'std' } 0.019984 0.013642 0.029275
subject {'var2' } {'var1' } {'corr'} -0.15137 NaN NaN
subject {'var1:var2' } {'var1' } {'corr'} 0.63492 0.52744 0.72239
subject {'var2' } {'var2' } {'std' } 0.052801 0.036326 0.076748
subject {'var1:var2' } {'var2' } {'corr'} 0.59288 NaN NaN
subject {'var1:var2' } {'var1:var2' } {'std' } 0.0013593 0.00073738 0.0025057
Any idea on why I get NaN values for some of the 'corr' parameters?
Thank you.

Paul on 5 Aug 2020
I feel this happens often when a model is too complex for the number of supplied datapoints, i.e. it happens because there's not enough data to produce those estimates. I often end up not including interaction effects in the random effects for that reason.