SCM

[#2119] discrepancy between stable version and development version of lme4

Date:
2012-07-03 08:55
Priority:
3
State:
Open
Submitted by:
Stéphane Laurent (sdl)
Assigned to:
Nobody (None)
Product:
lmer
Operating System:
Windows XP
Component:
R or C functions
Version:
None
Severity:
normal
Resolution:
None
URL:
Summary:
discrepancy between stable version and development version of lme4

Detailed description
Using R-2.15.1 and
- development version 0.99999911-0 of lme4
- stable version 0.999999-0 of lme4


* I get the following results with the development version :

dat <- read.csv("dat20101314.csv")
> ( fit <- lmer(y ~ (1|Operator)+(1|Part)+(1|Part:Operator), data=dat) )
Linear mixed model fit by REML ['lmerMod']
Formula: y ~ (1 | Operator) + (1 | Part) + (1 | Part:Operator)
Data: dat

REML criterion at convergence: -147.1594

Random effects:
Groups Name Variance Std.Dev.
Part:Operator (Intercept) 0.000000 0.00000
Operator (Intercept) 0.000000 0.00000
Part (Intercept) 0.398732 0.63145
Residual 0.001291 0.03593
Number of obs: 45, groups: Part:Operator, 24; Operator, 8; Part, 3

Fixed effects:
Estimate Std. Error t value
(Intercept) 2.7376 0.3646 7.508


* And the following results with the stable version:

> ( 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
-166.9 -157.8 88.43 -177 -176.9
Random effects:
Groups Name Variance Std.Dev.
Part:Operator (Intercept) 0.00015852 0.012590
Operator (Intercept) 0.00094545 0.030748
Part (Intercept) 0.39977089 0.632274
Residual 0.00031423 0.017726
Number of obs: 45, groups: Part:Operator, 24; Operator, 8; Part, 3

Fixed effects:
Estimate Std. Error t value
(Intercept) 2.7401 0.3652 7.503


* And SAS yields the same results as the stable version.

Comments:

Message  ↓
Date: 2012-11-17 15:04
Sender: Stéphane Laurent


Here is an example where lme4 development version gives almost the same results than SAS whereas the stable version gives slightly different results. The csv file is available in the attachments.

dd <- read.csv("datlme4.csv")
dd <- transform(dd, sample=factor(sample))

# lme4 cran :
lmer(log10(y) ~ (1|sample)+(1|operator)+(1|sample:operator), data=dd)

# lme4 development :
lmer(log10(y) ~ (1|sample)+(1|operator)+(1|sample:operator), data=dd,
control=list(restart=TRUE), optimizer="bobyqa")





Date: 2012-07-08 19:39
Sender: Ben Bolker

I've looked a bit at the second example and can't see that it has anything to do with boundary issues, rather it seems just to be a bobyqa/Nelder-Mead contrast. This is really tough. We have Nelder-Mead as a default: changing the default generically to bobyqa is a big deal and would require very careful thought and testing ...

Date: 2012-07-05 08:33
Sender: Stéphane Laurent

I have an example where BOTH arguments optimizer="bobyqa" and control=list(restart=TRUE) are required in order to get the good results.

I have attached the dataset, and the model is :
dat2 <- read.csv("dat2009_0551.csv")
lmer(y ~ (1|Sample)+(1|Day)+(1|Operator)+(1|Day:Sample)
+(1|Day:Operator)+(1|Sample:Operator)+(1|Day:Sample:Operator), data=dat2)

Date: 2012-07-04 06:35
Sender: Stéphane Laurent

I confirm that this works fine with either optimizer="bobyqa" or control=list(restart=TRUE).
Thanks !

Date: 2012-07-03 12:34
Sender: Ben Bolker

I'm pretty sure this is another case where Nelder-Mead is getting stuck at the boundary by accident. If so, then using optimizer="bobyqa" should be a temporary workaround; so should control=list(restart=TRUE) in the latest development version. I will play around with some ideas for automatic restarting from the boundary (my initial attempt was too crude and led to some problems with existing tests ...)

Attached Files:

Attachments:
Size Name Date By Download
1 KiBdat20101314.csv2012-07-03 08:55sdldat20101314.csv
10 KiBdat2009_0551.csv2012-07-05 08:33sdldat2009_0551.csv
548 bytesdatlme4.csv2012-11-17 15:04sdldatlme4.csv

Changes

Field Old Value Date By
File Added278: datlme4.csv2012-11-17 15:04sdl
File Added191: dat2009_0551.csv2012-07-05 08:33sdl
File Added190: dat20101314.csv2012-07-03 08:55sdl
Thanks to:
Vienna University of Economics and Business Powered By FusionForge