# [R-sig-ME] help with false convergence warning; sparse 1s in binary data

Fabiola Iannarilli |@nn@014 @end|ng |rom umn@edu
Tue Aug 27 21:52:33 CEST 2019

```Hi all!

I am using glmmTMB to model a set of time series of binary responses
collected at ~30 sites.  The probability of success fluctuates diurnally,
is likely to vary across sites, and I expect the data may also exhibit
short-term (serial) dependence.  Thus, I am including
sin(2*pi*time/(24*60)) and cos(2*pi*time/(24*60)) as fixed effects, a
random intercept for each site, and a within-site random effect that
follows an AR1 structure . The dataset is quite large (~2,200,000 records),
so I am initially exploring models fit to only a subset of the data
(~190,000 records).

> mod_1min <- glmmTMB(y ~ sin(2*pi*time/(24*60)) + cos(2*pi*time/(24*60)) +
(1|id) + ar1(as.factor(time) + 0 | id), data=y_1min, family=
binomial(link="logit"), ziformula = ~0)

Warning message:

In fitTMB(TMBStruc) :

Model convergence problem; false convergence (8). See
vignette('troubleshooting')

> summary(mod_1min)

Family: binomial  ( logit )

Formula:

y ~ sin(2 * pi * time/(24 * 60)) + cos(2 * pi * time/(24 * 60)) +

(1 | id) + ar1(as.factor(time) + 0 | id)

Data: y_1min

AIC      BIC   logLik deviance df.resid

224.0    278.5   -106.0    212.0    64803

Random effects:

Conditional model:

Groups Name                 Variance  Std.Dev. Corr

id     (Intercept)          7.908e-02  0.2812

id.1   as.factor(time)16999 4.084e+03 63.9073  0.33 (ar1)

Number of obs: 64809, groups:  id, 9

Conditional model:

Estimate Std. Error z value Pr(>|z|)

(Intercept)                  -19.4483     1.9487  -9.980   <2e-16 ***

sin(2 * pi * time/(24 * 60))  -0.1585     1.3361  -0.119    0.906

cos(2 * pi * time/(24 * 60))   0.2468     1.4576   0.169    0.866

---

Signif. codes:  0 â€˜***â€™ 0.001 â€˜**â€™ 0.01 â€˜*â€™ 0.05 â€˜.â€™ 0.1
â€˜ â€™ 1

glmmTMB gives a warning about false convergence. My guess is that this is
due to the low number of 1s in the data, which results in a flat likehood
and very low estimate for the intercept. My questions are:

1)      Is there a way to verify that the sparseness of 1s (and the
intercept) is the actual problem? If so, can I trust the inference for the
fixed effects parameters?

2)      My research questions also focus on evaluating the presence of
autocorrelation in the response.  I’m concerned that the variance
parameters are not well identified. Can I trust the estimate of the
autocorrelation parameter? Is there an alternative way to specify the model
that might improve convergence?

3)      Is it possible that a different optimizer or different Hessian
approximation might help? I tried the solution described at
https://github.com/glmmTMB/glmmTMB/issues/482, but it also gives a warning:

“45: In par[-random] <- par.fixed:   number of items to replace is not a
multiple of replacement length”

4)      Following the suggestion on this thread
https://github.com/glmmTMB/glmmTMB/issues/386, I am also running the same
model using INLA (given the dataset size, I am afraid MCMC will be too
computationally demanding), but there the problem is what priors to use.  I
am also running into memory allocation problems.

I would appreciate any suggestions you may have.

Best,

Fabiola