[R-pkg-team] Bug#921939: lme4 breaks r-cran-mlmrev autopkgtest

Paul Gevers elbrus at debian.org
Sun Feb 10 12:38:33 GMT 2019


Source: lme4, r-cran-mlmrev
Control: found -1 lme4/1.1-20-1
Control: found -1 r-cran-mlmrev/1.0-6-5
Severity: important
X-Debbugs-CC: debian-ci at lists.debian.org
User: debian-ci at lists.debian.org
Usertags: breaks needs-update

Dear maintainers,

With a recent upload of lme4 the autopkgtest of r-cran-mlmrev fails in
testing when that autopkgtest is run with the binary packages of lme4
from unstable. It passes when run with only packages from testing. In
tabular form:
                       pass            fail
lme4                   from testing    1.1-20-1
r-cran-mlmrev          from testing    1.0-6-5
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of lme4 to testing
[1]. Due to the nature of this issue, I filed this bug report against
both packages. Can you please investigate the situation and reassign the
bug to the right package? If needed, please change the bug's severity.

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=lme4

https://ci.debian.net/data/autopkgtest/testing/amd64/r/r-cran-mlmrev/1896877/log.gz

autopkgtest [04:42:02]: test run-unit-test: [-----------------------

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(mlmRev)
Loading required package: lme4
Loading required package: Matrix
> options(digits=6, useFancyQuotes = FALSE)# signif.stars for once..
> fm <- glmer(immun ~ kid2p + mom25p + ord + ethn + momEd +
+             husEd + momWork + rural + pcInd81 + (1|mom) + (1|comm),
+             data = guImmun, family = binomial)
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :>
  Model failed to converge with max|grad| = 0.379791 (tol = 0.001,
component 1)
print(fm, symbolic.cor = TRUE)
Generalized linear mixed model fit by maximum likelihood (Laplace
  Approximation) [glmerMod]
 Family: binomial  ( logit )
Formula: immun ~ kid2p + mom25p + ord + ethn + momEd + husEd + momWork +
    rural + pcInd81 + (1 | mom) + (1 | comm)
   Data: guImmun
     AIC      BIC   logLik deviance df.resid
 2747.50  2849.69 -1355.75  2711.50     2141
Random effects:
 Groups Name        Std.Dev.
 mom    (Intercept) 1.149
 comm   (Intercept) 0.726
Number of obs: 2159, groups:  mom, 1595; comm, 161
Fixed Effects:
(Intercept)       kid2pY      mom25pY        ord23        ord46
ord7p
   -0.87528      1.26566     -0.12819     -0.14590      0.16263
0.27387
      ethnN        ethnS       momEdP       momEdS       husEdP
husEdS
   -0.16411     -0.06192      0.28204      0.27803      0.38571
0.35188
     husEdU     momWorkY       ruralY      pcInd81
   -0.00285      0.25940     -0.67711     -0.85380
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
>
> fm.h <- update(fm, ~ . - husEd)
Warning message:
> In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.468307 (tol = 0.001,
component 1)
print(fm.h, corr = FALSE)
Generalized linear mixed model fit by maximum likelihood (Laplace
  Approximation) [glmerMod]
 Family: binomial  ( logit )
Formula: immun ~ kid2p + mom25p + ord + ethn + momEd + momWork + rural +
    pcInd81 + (1 | mom) + (1 | comm)
   Data: guImmun
     AIC      BIC   logLik deviance df.resid
 2748.60  2833.76 -1359.30  2718.60     2144
Random effects:
 Groups Name        Std.Dev.
 mom    (Intercept) 1.119
 comm   (Intercept) 0.723
Number of obs: 2159, groups:  mom, 1595; comm, 161
Fixed Effects:
(Intercept)       kid2pY      mom25pY        ord23        ord46
ord7p
     -0.609        1.261       -0.147       -0.149        0.151
0.230
      ethnN        ethnS       momEdP       momEdS     momWorkY
ruralY
     -0.246       -0.101        0.337        0.352        0.267
-0.715
    pcInd81
     -0.824
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
> fm.ho <- update(fm.h, ~ . - ord)
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.194562 (tol = 0.001,
component 1)
> ## FIXME: shows 53 outer iterations (+ probably IRLS ones) --
> ##        but no such info is kept stored
> print(fm.ho, corr = FALSE)
Generalized linear mixed model fit by maximum likelihood (Laplace
  Approximation) [glmerMod]
 Family: binomial  ( logit )
Formula: immun ~ kid2p + mom25p + ethn + momEd + momWork + rural +
pcInd81 +
    (1 | mom) + (1 | comm)
   Data: guImmun
     AIC      BIC   logLik deviance df.resid
 2746.30  2814.43 -1361.15  2722.30     2147
Random effects:
 Groups Name        Std.Dev.
 mom    (Intercept) 1.111
 comm   (Intercept) 0.711
Number of obs: 2159, groups:  mom, 1595; comm, 161
Fixed Effects:
(Intercept)       kid2pY      mom25pY        ethnN        ethnS
momEdP
    -0.6808       1.2644       0.0262      -0.2113      -0.0792
0.3306
     momEdS     momWorkY       ruralY      pcInd81
     0.3229       0.2487      -0.6803      -0.8419
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
>
> anova(fm, fm.h, fm.ho)
Data: guImmun
Models:
fm.ho: immun ~ kid2p + mom25p + ethn + momEd + momWork + rural + pcInd81 +
fm.ho:     (1 | mom) + (1 | comm)
fm.h: immun ~ kid2p + mom25p + ord + ethn + momEd + momWork + rural +
fm.h:     pcInd81 + (1 | mom) + (1 | comm)
fm: immun ~ kid2p + mom25p + ord + ethn + momEd + husEd + momWork +
fm:     rural + pcInd81 + (1 | mom) + (1 | comm)
      Df  AIC  BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fm.ho 12 2746 2814  -1361     2722
fm.h  15 2749 2834  -1359     2719 3.701      3     0.2956
fm    18 2748 2850  -1356     2712 7.100      3     0.0688 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> (fm.hoe <- update(fm.ho, ~ . - ethn))
Generalized linear mixed model fit by maximum likelihood (Laplace
  Approximation) [glmerMod]
 Family: binomial  ( logit )
Formula: immun ~ kid2p + mom25p + momEd + momWork + rural + pcInd81 +
    (1 | mom) + (1 | comm)
   Data: guImmun
     AIC      BIC   logLik deviance df.resid
 2742.77  2799.54 -1361.38  2722.77     2149
Random effects:
 Groups Name        Std.Dev.
 mom    (Intercept) 1.093
 comm   (Intercept) 0.698
Number of obs: 2159, groups:  mom, 1595; comm, 161
Fixed Effects:
(Intercept)       kid2pY      mom25pY       momEdP       momEdS
momWorkY
    -0.7017       1.2660       0.0252       0.3530       0.3604
0.2588
     ruralY      pcInd81
    -0.6709      -0.9534
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,
:convergence code 0; 1 optimizer warnings; 0 lme4 warnings

  Model failed to converge with max|grad| = 0.182133 (tol = 0.001,
component 1)
>
> (fm.hoem <- update(fm.hoe, ~ . - mom25p))
Generalized linear mixed model fit by maximum likelihood (Laplace
  Approximation) [glmerMod]
 Family: binomial  ( logit )
Formula: immun ~ kid2p + momEd + momWork + rural + pcInd81 + (1 | mom) +
    (1 | comm)
   Data: guImmun
     AIC      BIC   logLik deviance df.resid
 2740.80  2791.89 -1361.40  2722.80     2150
Random effects:
 Groups Name        Std.Dev.
 mom    (Intercept) 1.119
 comm   (Intercept) 0.696
Number of obs: 2159, groups:  mom, 1595; comm, 161
Fixed Effects:
(Intercept)       kid2pY       momEdP       momEdS     momWorkY
ruralY
     -0.699        1.262        0.359        0.361        0.273
-0.671
    pcInd81
     -0.946
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.0604445 (tol = 0.001,
component 1)
>
> (AN <- anova(fm, fm.h, fm.ho, fm.hoe, fm.hoem))
Data: guImmun
Models:
fm.hoem: immun ~ kid2p + momEd + momWork + rural + pcInd81 + (1 | mom) +
fm.hoem:     (1 | comm)
fm.hoe: immun ~ kid2p + mom25p + momEd + momWork + rural + pcInd81 +
fm.hoe:     (1 | mom) + (1 | comm)
fm.ho: immun ~ kid2p + mom25p + ethn + momEd + momWork + rural + pcInd81 +
fm.ho:     (1 | mom) + (1 | comm)
fm.h: immun ~ kid2p + mom25p + ord + ethn + momEd + momWork + rural +
fm.h:     pcInd81 + (1 | mom) + (1 | comm)
fm: immun ~ kid2p + mom25p + ord + ethn + momEd + husEd + momWork +
fm:     rural + pcInd81 + (1 | mom) + (1 | comm)
        Df  AIC  BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fm.hoem  9 2741 2792  -1361     2723
fm.hoe  10 2743 2800  -1361     2723 0.026      1     0.8708
fm.ho   12 2746 2814  -1361     2722 0.471      2     0.7903
fm.h    15 2749 2834  -1359     2719 3.701      3     0.2956
fm      18 2748 2850  -1356     2712 7.100      3     0.0688 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> AN[, "logLik"] + 1362                   # an inversion in the first
two models
[1] 0.601852 0.615079 0.850417 2.701100 6.251044
> ## FIXME: AN doesn't have a deviance column!
> ## AN[, "deviance"] - 2711                 # deviance scale shows this
more clearly
> stopifnot(AN[,"Df"] == c(9,10,12,15,18),
+ #          all.equal(AN[,"logLik"] + 1362,
+ #                    c(0.6072186497422, 0.6289103306312, 0.8541186984307,
+ #                      2.725550814599, 6.299084917162), tol = 1e-6),
+ #          all.equal(fixef(fm.hoem)[-1],
+ #                    c("kid2pY" = 1.2662536,  "momEdP"= 0.35116180,
+ #                      "momEdS"= 0.3487824136, "momWorkY"=0.2672759992340,
+ #                      "ruralY"=-0.678846606719,
"pcInd81"=-0.9612710104134),
+ #                    tol = 1e-4),
+           TRUE
+           )
>
>
> cat('Time elapsed: ', proc.time(),'\n') # "stats"
Time elapsed:  110.268 0.116 110.452 0 0
>

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ####  LMER: Put all the small data set tests into one file
> library(mlmRev)
Loading required package: lme4
Loading required package: Matrix
> options(digits=6, show.signif.stars = FALSE)
>
> ## bdf ---------------- Data ---------------------
> (fm01 <- lmer(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen +
(1|schoolNR), bdf))
Linear mixed model fit by REML ['lmerMod']
Formula: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (1 | schoolNR)
   Data: bdf
REML criterion at convergence: 15232.2
Random effects:
 Groups   Name        Std.Dev.
 schoolNR (Intercept) 2.81
 Residual             6.49
Number of obs: 2287, groups:  schoolNR, 131
Fixed Effects:
   (Intercept)      IQ.ver.cen  avg.IQ.ver.cen
         40.74            2.41            1.59
> (fm02 <- lmer(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen
+(IQ.ver.cen|schoolNR), bdf))
Linear mixed model fit by REML ['lmerMod']
Formula: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (IQ.ver.cen | schoolNR)
   Data: bdf
REML criterion at convergence: 15217.9
Random effects:
 Groups   Name        Std.Dev. Corr
 schoolNR (Intercept) 2.842
          IQ.ver.cen  0.456    -0.64
 Residual             6.430
Number of obs: 2287, groups:  schoolNR, 131
Fixed Effects:
   (Intercept)      IQ.ver.cen  avg.IQ.ver.cen
         40.75            2.46            1.41
> ##
> anova(fm01, fm02)
refitting model(s) with ML (instead of REML)
Data: bdf
Models:
fm01: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (1 | schoolNR)
fm02: langPOST ~ IQ.ver.cen + avg.IQ.ver.cen + (IQ.ver.cen | schoolNR)
     Df   AIC   BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fm01  5 15238 15266  -7614    15228
fm02  7 15228 15268  -7607    15214 14.01      2   0.000905
> cat('Time elapsed: ', (.pt <- proc.time()),'\n') # "stats"
Time elapsed:  1.436 0.1 1.533 0 0
>
> ## egsingle ----------- Data ---------------------
> (fm1 <- lmer(math ~ year +    (1|childid) +    (1|schoolid), egsingle))
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ year + (1 | childid) + (1 | schoolid)
   Data: egsingle
REML criterion at convergence: 16759.4
Random effects:
 Groups   Name        Std.Dev.
 childid  (Intercept) 0.818
 schoolid (Intercept) 0.432
 Residual             0.589
Number of obs: 7230, groups:  childid, 1721; schoolid, 60
Fixed Effects:
(Intercept)         year
     -0.780        0.746
> (fm2 <- lmer(math ~ year +    (1|childid) + (year|schoolid), egsingle))
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ year + (1 | childid) + (year | schoolid)
   Data: egsingle
REML criterion at convergence: 16482.4
Random effects:
 Groups   Name        Std.Dev. Corr
 childid  (Intercept) 0.820
 schoolid (Intercept) 0.408
          year        0.108    0.44
 Residual             0.570
Number of obs: 7230, groups:  childid, 1721; schoolid, 60
Fixed Effects:
(Intercept)         year
     -0.777        0.763
> (fm3 <- lmer(math ~ year + (year|childid) +    (1|schoolid), egsingle))
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ year + (year | childid) + (1 | schoolid)
   Data: egsingle
REML criterion at convergence: 16517.5
Random effects:
 Groups   Name        Std.Dev. Corr
 childid  (Intercept) 0.805
          year        0.147    0.46
 schoolid (Intercept) 0.392
 Residual             0.549
Number of obs: 7230, groups:  childid, 1721; schoolid, 60
Fixed Effects:
(Intercept)         year
     -0.793        0.747
> (fm4 <- lmer(math ~ year + (year|childid) + (year|schoolid), egsingle))
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ year + (year | childid) + (year | schoolid)
   Data: egsingle
REML criterion at convergence: 16336.7
Random effects:
 Groups   Name        Std.Dev. Corr
 childid  (Intercept) 0.800
          year        0.106    0.55
 schoolid (Intercept) 0.411
          year        0.106    0.40
 Residual             0.549
Number of obs: 7230, groups:  childid, 1721; schoolid, 60
Fixed Effects:
(Intercept)         year
     -0.779        0.763
> ##
> anova(fm1, fm2, fm3, fm4)
refitting model(s) with ML (instead of REML)
Data: egsingle
Models:
fm1: math ~ year + (1 | childid) + (1 | schoolid)
fm2: math ~ year + (1 | childid) + (year | schoolid)
fm3: math ~ year + (year | childid) + (1 | schoolid)
fm4: math ~ year + (year | childid) + (year | schoolid)
    Df   AIC   BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fm1  5 16757 16791  -8374    16747
fm2  7 16486 16534  -8236    16472 275.2      2     <2e-16
fm3  7 16519 16567  -8253    16505   0.0      0          1
fm4  9 16344 16406  -8163    16326 179.1      2     <2e-16
> cat('Time elapsed: ', {.ot <- .pt; (.pt <- proc.time()) - .ot},'\n') #
"stats"
Time elapsed:  2.856 0.012 2.869 0 0
>
> ## Early -------------- Data ---------------------
> Early$tos <- Early$age - 0.5
> (fm1E <- lmer(cog ~ tos * trt + (tos|id), Early))
singular fit
Linear mixed model fit by REML ['lmerMod']
Formula: cog ~ tos * trt + (tos | id)
   Data: Early
REML criterion at convergence: 2358.74
Random effects:
 Groups   Name        Std.Dev. Corr
 id       (Intercept) 12.86
          tos          3.21    -1.00
 Residual              8.69
Number of obs: 309, groups:  id, 103
Fixed Effects:
(Intercept)          tos         trtY     tos:trtY
     118.41       -21.13         4.22         5.27
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
>
> ## Exam --------------- Data ---------------------
> (fm05 <- lmer(normexam ~ standLRT + sex + schgend + (1|school), Exam))
Linear mixed model fit by REML ['lmerMod']
Formula: normexam ~ standLRT + sex + schgend + (1 | school)
   Data: Exam
REML criterion at convergence: 9347.67
Random effects:
 Groups   Name        Std.Dev.
 school   (Intercept) 0.293
 Residual             0.750
Number of obs: 4059, groups:  school, 65
Fixed Effects:
 (Intercept)      standLRT          sexM   schgendboys  schgendgirls
    -0.00105       0.55975      -0.16739       0.17769       0.15900
>
> ## Chem97 ------------- Data ---------------------
> (fm06 <- lmer(score ~ gcsecnt + (1|school) + (1|lea), Chem97))
Linear mixed model fit by REML ['lmerMod']
Formula: score ~ gcsecnt + (1 | school) + (1 | lea)
   Data: Chem97
REML criterion at convergence: 141697
Random effects:
 Groups   Name        Std.Dev.
 school   (Intercept) 1.080
 lea      (Intercept) 0.122
 Residual             2.270
Number of obs: 31022, groups:  school, 2410; lea, 131
Fixed Effects:
(Intercept)      gcsecnt
       5.64         2.47
>
> cat('Time elapsed: ', {.ot <- .pt; (.pt <- proc.time()) - .ot},'\n') #
"stats"
Time elapsed:  0.56 0.012 0.573 0 0
>
> ## Hsb82 -------------- Data ---------------------
> lmer(mAch ~ meanses*cses + sector*cses + (cses|school), Hsb82)
Linear mixed model fit by REML ['lmerMod']
Formula: mAch ~ meanses * cses + sector * cses + (cses | school)
   Data: Hsb82
REML criterion at convergence: 46503.7
Random effects:
 Groups   Name        Std.Dev. Corr
 school   (Intercept) 1.543
          cses        0.318    0.39
 Residual             6.060
Number of obs: 7185, groups:  school, 160
Fixed Effects:
        (Intercept)              meanses                 cses
              12.13                 5.33                 2.95
     sectorCatholic         meanses:cses  cses:sectorCatholic
               1.23                 1.04                -1.64
>
> ## Oxford ------------- Data ---------------------
> (fm07 <- lmer(height ~ age + I(age^2) + I(age^3) + I(age^4) +
+               (age + I(age^2)|Subject),  data = Oxboys))
Linear mixed model fit by REML ['lmerMod']
Formula: height ~ age + I(age^2) + I(age^3) + I(age^4) + (age + I(age^2) |
    Subject)
   Data: Oxboys
REML criterion at convergence: 627.908
Random effects:
 Groups   Name        Std.Dev. Corr
 Subject  (Intercept) 8.003
          age         1.693    0.61
          I(age^2)    0.821    0.22 0.66
 Residual             0.466
Number of obs: 234, groups:  Subject, 26
Fixed Effects:
(Intercept)          age     I(age^2)     I(age^3)     I(age^4)
    149.019        6.174        1.128        0.454       -0.377
convergence code 0; 1 optimizer warnings; 0 lme4 warnings
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.00425429 (tol = 0.002,
component 1)
> (fm08 <- lmer(height ~ poly(age,4) +
+               (age + I(age^2)|Subject),  data = Oxboys))
Linear mixed model fit by REML ['lmerMod']
Formula: height ~ poly(age, 4) + (age + I(age^2) | Subject)
   Data: Oxboys
REML criterion at convergence: 616.869
Random effects:
 Groups   Name        Std.Dev. Corr
 Subject  (Intercept) 8.004
          age         1.692    0.61
          I(age^2)    0.821    0.22 0.66
 Residual             0.466
Number of obs: 234, groups:  Subject, 26
Fixed Effects:
  (Intercept)  poly(age, 4)1  poly(age, 4)2  poly(age, 4)3  poly(age, 4)4
      149.520         64.541          4.203          1.291         -0.585
> anova(fm07, fm08)
refitting model(s) with ML (instead of REML)
Data: Oxboys
Models:
fm07: height ~ age + I(age^2) + I(age^3) + I(age^4) + (age + I(age^2) |
fm07:     Subject)
fm08: height ~ poly(age, 4) + (age + I(age^2) | Subject)
     Df   AIC   BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fm07 12 649.3 690.8 -312.7    625.3
fm08 12 649.3 690.8 -312.7    625.3     0      0          1
> stopifnot(all.equal(logLik(fm07, REML=FALSE),
+                     logLik(fm08, REML=FALSE), tol=1e-07))
Error: logLik(fm07, REML = FALSE) and logLik(fm08, REML = FALSE) are not
equal:
  Mean relative difference: 4.53445e-07
Execution halted
autopkgtest [04:43:59]: test run-unit-test: -----------------------]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/r-pkg-team/attachments/20190210/5e6c70bb/attachment.sig>


More information about the R-pkg-team mailing list