Skip to content

Convergence Error: 0 Fixed Correlations and More

6 messages · Chris Heffner, Thierry Onkelinx, Emmanuel Curis +1 more

#
Hi,

I'm running a psychology experiment with a few fixed effects and random
factors, but for some of the models that I'm comparing I get an output that
looks something like this:

Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) ['glmerMod']
 Family: binomial  ( logit )
Formula: FW ~ FactorA + FactorB + FactorC + FactorA:FactorC +
FactorB:FactorC +      (1 | participant) + (1 + FactorC || item)
   Data: east.acc1.subset
Control: glmerControl(optCtrl = list(maxfun = 30000))

     AIC      BIC   logLik deviance df.resid
  1001.5   1066.9   -487.7    975.5     1120

Scaled residuals:
    Min      1Q  Median      3Q     Max
-3.8335 -0.3041  0.1416  0.3566  2.8851

Random effects:
 Groups      Name        Variance  Std.Dev.  Corr
 item     FactorCB       5.454e+00 2.3352985
             FactorCS       3.097e+00 1.7597629 -0.81
 item.1   (Intercept) 5.437e+00 2.3316731
 participant (Intercept) 2.595e-08 0.0001611
Number of obs: 1133, groups:  item, 55; participant, 23

(Intercept)            0.1928833  0.0006222   310.0   <2e-16 ***
FactorAInitial        1.8077886  0.0006222  2905.5   <2e-16 ***
FactorB150        -0.4506653  0.0006220  -724.5   <2e-16 ***
FactorB200        -0.5485114  0.0006220  -881.9   <2e-16 ***
FactorCS                 -0.3923921  0.0006221  -630.8   <2e-16 ***
FactorAInitial:FactorCS -0.0889474  0.0006221  -143.0   <2e-16 ***
FactorB150:FactorCS   0.1347207  0.0006221   216.6   <2e-16 ***
FactorB200:FactorCS   0.0682518  0.0006221   109.7   <2e-16 ***
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1

Correlation of Fixed Effects:
            (Intr) FAIn FB150 FB200 FCS FAI:FCS FB150:FCS
FAIntl 0.000
FB150 0.000  0.000
FB200 0.000  0.000  0.000
FCS       0.000  0.000  0.000  0.000
FaInt:FCS 0.000  0.000  0.000  0.000  0.000
FB150:FCS 0.000  0.000  0.000  0.000  0.000 0.000
FB200:FCS 0.000  0.000  0.000  0.000  0.000 0.000  0.000

convergence code: 0
Model failed to converge with max|grad| = 0.113738 (tol = 0.001, component
1)
Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?

I've tried look through my data, as my first thought was that data was
somehow miscoded, but I can't see anything that would be the matter.  A
more complicated version of the model had the same problem until I got rid
of a single participant (who seemed otherwise entirely unexceptional).  The
more complicated model now converges fine, but this simpler one now has
these issues.  I have an almost identical dataset that I've been doing
almost exactly the same models with that hasn't been giving me similar
problems.

Any thoughts?

Thank you,

Chris
#
Dear Chris,

The correct syntax is (1 + FactorC | item) not (1 + FactorC || item).
Use a single |. I find the item.1 strange in the output. This might be
due to the syntax error.

The item random effect variances are quit high. You might have a
problem of quasi-complete separation. (1 + FactorC | item) might be
too complex for your data. Does (1 | item) converge?

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no
more than asking him to perform a post-mortem examination: he may be
able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data. ~ John Tukey


2015-09-21 18:37 GMT+02:00 Chris Heffner <heffner at umd.edu>:
#
Hello Thierry,

Thanks for the input!  The || syntax is intentional; it gets rid of the
correlation parameters between the random effects in the model.  This was
done based on my reading of the Bates, Kliegl, Vasishth, and Baayen
manuscript ("Parsimonious mixed models") from earlier this year as a way to
tamp down on overcomplexity.  However, changing it to a single pipe, (1 +
FactorC | item), does not affect convergence, although the warnings I get
change:

1: In vcov.merMod(object, use.hessian = use.hessian) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov
estimated from RX
2: In vcov.merMod(object, correlation = correlation, sigm = sig) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov
estimated from RX1: In vcov.merMod(object, use.hessian = use.hessian) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov
estimated from RX
2: In vcov.merMod(object, correlation = correlation, sigm = sig) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov
estimated from RX

(1 | item) converges... but so does (1 + FactorB + FactorC | item), which
to me seems to argue against model complexity being the cause.

Thank you,

Chris

On Tue, Sep 22, 2015 at 3:34 AM Thierry Onkelinx <thierry.onkelinx at inbo.be>
wrote:

  
  
#
On Tue, Sep 22, 2015 at 3:33 AM, Thierry Onkelinx
<thierry.onkelinx at inbo.be> wrote:
Chris might be trying to suppress the correlations between
random-effect component:
the double-bar notation expands to (1|item) + (0 + FactorC | item),
but there's a problem here: there's not *really* a way to do this with the
double-bar syntax.  If FactorC has two levels (B and S), then the
right (tedious)
way to do this is

( 1|item)+(0+dummy(FactorC,"C")|item)

or maybe (?)

(0+dummy(FactorC,"C")|item)(0+dummy(FactorC,"C")|item)



(I think the current model is overparameterized)
[snip]
#
Speaking about this factor variables coding to have uncorrelated
random effects... Following Thierry Onkelinx's advice [thanks a lot
for this advice, by the way, I think I didn't answered yet, sorry], I
wrote down the models for a similar case, and it turned out that when
having uncorrelated random effects for all levels of a covariate, then
the Y variables were also uncorrelated, but it allowed different
variances for each level.

I thought one advantage of random effects was to introduce
correlations between observations taken for the same patient, so I
wonder if this trick really does what one expects (assuming I didn't
made mistakes, and I am not the only one to have this idea about
consequences of random effects), and that specifying special random
effects covariance matrix structures is less error-prone with nlme?

Best regards,
On Tue, Sep 22, 2015 at 09:40:26AM -0400, Ben Bolker wrote:
? On Tue, Sep 22, 2015 at 3:33 AM, Thierry Onkelinx
? <thierry.onkelinx at inbo.be> wrote:
? > Dear Chris,
? >
? > The correct syntax is (1 + FactorC | item) not (1 + FactorC || item).
? > Use a single |. I find the item.1 strange in the output. This might be
? > due to the syntax error.
? 
?    Chris might be trying to suppress the correlations between
? random-effect component:
? the double-bar notation expands to (1|item) + (0 + FactorC | item),
? but there's a problem here: there's not *really* a way to do this with the
? double-bar syntax.  If FactorC has two levels (B and S), then the
? right (tedious)
? way to do this is
? 
? ( 1|item)+(0+dummy(FactorC,"C")|item)
? 
? or maybe (?)
? 
? (0+dummy(FactorC,"C")|item)(0+dummy(FactorC,"C")|item)
? 
? 
? 
? (I think the current model is overparameterized)
? 
? >
? > The item random effect variances are quit high. You might have a
? > problem of quasi-complete separation. (1 + FactorC | item) might be
? > too complex for your data. Does (1 | item) converge?
? >
? > Best regards,
? >
? > ir. Thierry Onkelinx
? > Instituut voor natuur- en bosonderzoek / Research Institute for Nature
? > and Forest
? > team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
? > Kliniekstraat 25
? > 1070 Anderlecht
? > Belgium
? 
? 
?   [snip]
? 
? >
? >
? > 2015-09-21 18:37 GMT+02:00 Chris Heffner <heffner at umd.edu>:
? >> Hi,
? >>
? >> I'm running a psychology experiment with a few fixed effects and random
? >> factors, but for some of the models that I'm comparing I get an output that
? >> looks something like this:
? >>
? >> Generalized linear mixed model fit by maximum likelihood (Laplace
? >> Approximation) ['glmerMod']
? >>  Family: binomial  ( logit )
? >> Formula: FW ~ FactorA + FactorB + FactorC + FactorA:FactorC +
? >> FactorB:FactorC +      (1 | participant) + (1 + FactorC || item)
? >>    Data: east.acc1.subset
? >> Control: glmerControl(optCtrl = list(maxfun = 30000))
? >>
? >>      AIC      BIC   logLik deviance df.resid
? >>   1001.5   1066.9   -487.7    975.5     1120
? >>
? >> Scaled residuals:
? >>     Min      1Q  Median      3Q     Max
? >> -3.8335 -0.3041  0.1416  0.3566  2.8851
? >>
? >> Random effects:
? >>  Groups      Name        Variance  Std.Dev.  Corr
? >>  item     FactorCB       5.454e+00 2.3352985
? >>              FactorCS       3.097e+00 1.7597629 -0.81
? >>  item.1   (Intercept) 5.437e+00 2.3316731
? >>  participant (Intercept) 2.595e-08 0.0001611
? >> Number of obs: 1133, groups:  item, 55; participant, 23
? >>
? >> (Intercept)            0.1928833  0.0006222   310.0   <2e-16 ***
? >> FactorAInitial        1.8077886  0.0006222  2905.5   <2e-16 ***
? >> FactorB150        -0.4506653  0.0006220  -724.5   <2e-16 ***
? >> FactorB200        -0.5485114  0.0006220  -881.9   <2e-16 ***
? >> FactorCS                 -0.3923921  0.0006221  -630.8   <2e-16 ***
? >> FactorAInitial:FactorCS -0.0889474  0.0006221  -143.0   <2e-16 ***
? >> FactorB150:FactorCS   0.1347207  0.0006221   216.6   <2e-16 ***
? >> FactorB200:FactorCS   0.0682518  0.0006221   109.7   <2e-16 ***
? >> ---
? >> Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
? >>
? >> Correlation of Fixed Effects:
? >>             (Intr) FAIn FB150 FB200 FCS FAI:FCS FB150:FCS
? >> FAIntl 0.000
? >> FB150 0.000  0.000
? >> FB200 0.000  0.000  0.000
? >> FCS       0.000  0.000  0.000  0.000
? >> FaInt:FCS 0.000  0.000  0.000  0.000  0.000
? >> FB150:FCS 0.000  0.000  0.000  0.000  0.000 0.000
? >> FB200:FCS 0.000  0.000  0.000  0.000  0.000 0.000  0.000
? >>
? >> convergence code: 0
? >> Model failed to converge with max|grad| = 0.113738 (tol = 0.001, component
? >> 1)
? >> Model is nearly unidentifiable: very large eigenvalue
? >>  - Rescale variables?
? >>
? >> I've tried look through my data, as my first thought was that data was
? >> somehow miscoded, but I can't see anything that would be the matter.  A
? >> more complicated version of the model had the same problem until I got rid
? >> of a single participant (who seemed otherwise entirely unexceptional).  The
? >> more complicated model now converges fine, but this simpler one now has
? >> these issues.  I have an almost identical dataset that I've been doing
? >> almost exactly the same models with that hasn't been giving me similar
? >> problems.
? >>
? >> Any thoughts?
? >>
? >> Thank you,
? >>
? >> Chris
? >>
? >>         [[alternative HTML version deleted]]
? >>
? >> _______________________________________________
? >> R-sig-mixed-models at r-project.org mailing list
? >> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
? >
? > _______________________________________________
? > R-sig-mixed-models at r-project.org mailing list
? > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
? 
? _______________________________________________
? R-sig-mixed-models at r-project.org mailing list
? https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
2 days later
#
Emmanuel Curis <emmanuel.curis at ...> writes:
I think at least one of us is confused.  Specifying uncorrelated
random effects terms doesn't (I think) mean the predictor variables are 
uncorrelated.  It means the variation of the effects of predictor
variables across groups is uncorrelated.  

  In particular, if the model specifies that the intercept term varies
across groups, then this *does* induce correlations within groups,
because the observations within the group share a random effect
(which means there is less variation within a group than across
the overall population).  Admittedly, this is the only kind of
correlation the stable branch of lme4 allows (not AR1, or
other interesting correlation structures -- only (positive)
compound symmetry.  If nlme works for your problem, by all means
use it ... but lme4 does 'real' GLMMs (not just via PQL), and
is faster than nlme for LMMs ...


 [snipped context to make Gmane happy]