An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20120705/bd67cbeb/attachment.pl>
singular convergence with lmer()
8 messages · laurent stephane, Ben Bolker, Reinhold Kliegl +4 more
3 days later
laurent stephane <laurent_step at ...> writes:
Dear all, Using the latest CRAN version of lme4 I get the following warning from lmer() : Warning message: In mer_finalize(ans) : singular convergence (7)
My model is not complicated and it works fine with SAS (if you are interested in the details of my model see forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 )
What argument could I change in lmer() to overcome this warning ?
This warning emerges from the nlminb optimizer used in the guts of lme4, and I don't think there's much you can do to suppress it or change the behavior of nlminb to avoid it. The best you could do would be to use other packages (SAS, other versions of lme4 or nlme, etc.) to see if the correct answer was achieved despite the warning. Ben Bolker
It converged for me for lme4_0.999999-0. Estimates look different from what you posted at the site. Reinhold Kliegl
dat$Part <- factor(dat$Part) ( fit <- lmer(y ~ (1|Operator)+(1|Part)+(1|Part:Operator), data=dat) )
Linear mixed model fit by REML
Formula: y ~ (1 | Operator) + (1 | Part) + (1 | Part:Operator)
Data: dat
AIC BIC logLik deviance REMLdev
-619.7 -603.4 314.9 -630.3 -629.7
Random effects:
Groups Name Variance Std.Dev.
Part:Operator (Intercept) 0.00081854 0.028610
Part (Intercept) 1.06721729 1.033062
Operator (Intercept) 0.00031226 0.017671
Residual 0.00063295 0.025159
Number of obs: 192, groups: Part:Operator, 96; Part, 12; Operator, 8
Fixed effects:
Estimate Std. Error t value
(Intercept) 2.7171 0.2983 9.109
On Sun, Jul 8, 2012 at 9:58 PM, Ben Bolker <bbolker at gmail.com> wrote:
laurent stephane <laurent_step at ...> writes:
Dear all, Using the latest CRAN version of lme4 I get the following warning from lmer() : Warning message: In mer_finalize(ans) : singular convergence (7)
My model is not complicated and it works fine with SAS (if you are interested in the details of my model see forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 )
What argument could I change in lmer() to overcome this warning ?
This warning emerges from the nlminb optimizer used in the guts of lme4, and I don't think there's much you can do to suppress it or change the behavior of nlminb to avoid it. The best you could do would be to use other packages (SAS, other versions of lme4 or nlme, etc.) to see if the correct answer was achieved despite the warning. Ben Bolker
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Notice that the variance of one of your random effects is estimated at 0. I suspect that this is the source of the singular convergence. IIRC proc mixed (which is what I assume you are using in SAS) uses a somewhat different approach to to estimate the random effects than does lme4. Although it seems to work for Reinhold, again some of the variances are vanishingly small, which seems to me like it may suggest some of the effects are borderline on 0 and perhaps slightly different estimation methods either get "really small" or simply "0" and if 0, you get a warning. I would also consider simplifying your model (although likelihood ratio tests seem to suggest a significant decrement in the likelihood fixing the variance at 0). Cheers, Josh
On Thu, Jul 5, 2012 at 1:01 AM, laurent stephane <laurent_step at yahoo.fr> wrote:
Dear all,
Using the latest CRAN version of lme4 I get the following warning from lmer() :
Warning message:
In mer_finalize(ans) : singular convergence (7)
My model is not complicated and it works fine with SAS (if you are interested in the details of my model see forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 )
What argument could I change in lmer() to overcome this warning ?
Kind regards,
SL
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/
I wonder if it is a version issue. Using the data at forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 I get the following (which matches what SAS produces):
str(dat)
'data.frame': 192 obs. of 3 variables: $ Operator: Factor w/ 8 levels "A","B","C","D",..: 1 1 1 1 1 1 1 1 1 1 ... $ Part : Factor w/ 12 levels "1","2","3","4",..: 1 1 2 2 3 3 4 4 5 5 ... $ y : num 0.724 0.699 1.554 1.535 1.786 ...
fit
Linear mixed model fit by REML
Formula: y ~ (1 | Operator) + (1 | Part) + (1 | Part:Operator)
Data: dat
AIC BIC logLik deviance REMLdev
-619.7 -603.4 314.9 -630.3 -629.7
Random effects:
Groups Name Variance Std.Dev.
Part:Operator (Intercept) 0.00081854 0.028610
Part (Intercept) 1.06721993 1.033063
Operator (Intercept) 0.00031226 0.017671
Residual 0.00063295 0.025159
Number of obs: 192, groups: Part:Operator, 96; Part, 12; Operator, 8
Fixed effects:
Estimate Std. Error t value
(Intercept) 2.7171 0.2983 9.109
I'm using R 1.15.0 32-bit on Windows XP and Package lme4 version 0.999375-42.
Jim Baldwin
Pacific Southwest Research Station
USDA Forest Service
Albany, California
-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Joshua Wiley
Sent: Sunday, July 08, 2012 1:52 PM
To: laurent stephane
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] singular convergence with lmer()
Notice that the variance of one of your random effects is estimated at 0. I suspect that this is the source of the singular convergence.
IIRC proc mixed (which is what I assume you are using in SAS) uses a somewhat different approach to to estimate the random effects than does lme4.
Although it seems to work for Reinhold, again some of the variances are vanishingly small, which seems to me like it may suggest some of the effects are borderline on 0 and perhaps slightly different estimation methods either get "really small" or simply "0" and if 0, you get a warning. I would also consider simplifying your model (although likelihood ratio tests seem to suggest a significant decrement in the likelihood fixing the variance at 0).
Cheers,
Josh
On Thu, Jul 5, 2012 at 1:01 AM, laurent stephane <laurent_step at yahoo.fr> wrote:
Dear all,
Using the latest CRAN version of lme4 I get the following warning from lmer() :
Warning message:
In mer_finalize(ans) : singular convergence (7)
My model is not complicated and it works fine with SAS (if you are
interested in the details of my model see
forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 )
What argument could I change in lmer() to overcome this warning ?
Kind regards,
SL
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
-- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/ _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
On Sun, 8 Jul 2012, Reinhold Kliegl wrote:
It converged for me for lme4_0.999999-0. Estimates look different from what you posted at the site. Reinhold Kliegl
dat$Part <- factor(dat$Part) ( fit <- lmer(y ~ (1|Operator)+(1|Part)+(1|Part:Operator), data=dat) )
Linear mixed model fit by REML
Formula: y ~ (1 | Operator) + (1 | Part) + (1 | Part:Operator)
Data: dat
AIC BIC logLik deviance REMLdev
-619.7 -603.4 314.9 -630.3 -629.7
Random effects:
Groups Name Variance Std.Dev.
Part:Operator (Intercept) 0.00081854 0.028610
Part (Intercept) 1.06721729 1.033062
Operator (Intercept) 0.00031226 0.017671
Residual 0.00063295 0.025159
Number of obs: 192, groups: Part:Operator, 96; Part 12; Operator, 8
Fixed effects:
Estimate Std. Error t value
(Intercept) 2.7171 0.2983 9.109
The regress package (1.3-8) also gives
r1 <- regress(y ~ 1, ~ Operator+Part+I(Operator:Part), data=dat)
r1$sigma
Operator Part I(Operator:Part) In
0.0003122871 1.0671419239 0.0008185268 0.0006329560
FWIW, I get the same result using
packageVersion('lme4')
[1] ?0.999999.0?
Dennis
On Sun, Jul 8, 2012 at 2:58 PM, Baldwin, Jim -FS <jbaldwin at fs.fed.us> wrote:
I wonder if it is a version issue. Using the data at forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 I get the following (which matches what SAS produces):
str(dat)
'data.frame': 192 obs. of 3 variables: $ Operator: Factor w/ 8 levels "A","B","C","D",..: 1 1 1 1 1 1 1 1 1 1 ... $ Part : Factor w/ 12 levels "1","2","3","4",..: 1 1 2 2 3 3 4 4 5 5 ... $ y : num 0.724 0.699 1.554 1.535 1.786 ...
fit
Linear mixed model fit by REML
Formula: y ~ (1 | Operator) + (1 | Part) + (1 | Part:Operator)
Data: dat
AIC BIC logLik deviance REMLdev
-619.7 -603.4 314.9 -630.3 -629.7
Random effects:
Groups Name Variance Std.Dev.
Part:Operator (Intercept) 0.00081854 0.028610
Part (Intercept) 1.06721993 1.033063
Operator (Intercept) 0.00031226 0.017671
Residual 0.00063295 0.025159
Number of obs: 192, groups: Part:Operator, 96; Part, 12; Operator, 8
Fixed effects:
Estimate Std. Error t value
(Intercept) 2.7171 0.2983 9.109
I'm using R 1.15.0 32-bit on Windows XP and Package lme4 version 0.999375-42.
Jim Baldwin
Pacific Southwest Research Station
USDA Forest Service
Albany, California
-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Joshua Wiley
Sent: Sunday, July 08, 2012 1:52 PM
To: laurent stephane
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] singular convergence with lmer()
Notice that the variance of one of your random effects is estimated at 0. I suspect that this is the source of the singular convergence.
IIRC proc mixed (which is what I assume you are using in SAS) uses a somewhat different approach to to estimate the random effects than does lme4.
Although it seems to work for Reinhold, again some of the variances are vanishingly small, which seems to me like it may suggest some of the effects are borderline on 0 and perhaps slightly different estimation methods either get "really small" or simply "0" and if 0, you get a warning. I would also consider simplifying your model (although likelihood ratio tests seem to suggest a significant decrement in the likelihood fixing the variance at 0).
Cheers,
Josh
On Thu, Jul 5, 2012 at 1:01 AM, laurent stephane <laurent_step at yahoo.fr> wrote:
Dear all,
Using the latest CRAN version of lme4 I get the following warning from lmer() :
Warning message:
In mer_finalize(ans) : singular convergence (7)
My model is not complicated and it works fine with SAS (if you are
interested in the details of my model see
forums.cirad.fr/logiciel-R/viewtopic.php?t=5071 )
What argument could I change in lmer() to overcome this warning ?
Kind regards,
SL
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
-- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately. _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20120709/ac4b2f3f/attachment.pl>