Hello all,

First of all I don't know if I am in the right news group to report bug / suspicious behavior in lme4. If not I do apologize.

I am currently developing a linear mixed model implementation. For testing I used the model

y ~ dose * day + (1 | comp)

and compared my implementation with lmer from lme4_0.999375-32 for about 30'000 different values of y.
Generally the comparison is quite good but for certain y values (approx 100) I found small differences. Looking closer at some of those cases  I observe that the optimization reaches 0 but then it  cannot "escape" from anymore.

One example, reproducible with the data provided below:
>fit <- lmer(y ~ dose * day + (1 | comp), verbose=TRUE)
  0:    -21.202738: 0.245256
  1:    -21.863496:  0.00000
  2:    -21.863496: 4.14318e-06

Plotting the one dimensional reduced deviance reveals a minimum at ~ 0.0862 (this minimum can also be found by providing a different start value).

> fit <- lmer(y ~ dose * day + (1 | comp), verbose=TRUE, start = c(0.05))
  0:    -21.917896: 0.0500000
  1:    -21.950001: 0.0784911
  2:    -21.951063: 0.0913211
  3:    -21.951911: 0.0860209
  4:    -21.951913: 0.0862628
  5:    -21.951913: 0.0862698

In my implementation I had similar problems when I had to evaluate the likelihood at very small numbers it began to fluctuated and the optimizer had been trapped in a local minimum due to these numeric instabilities.

Is this behavior known or do I maybe use lmer in a wrong way?

Thanks very much,

Oliver Duerr

Command to reproduce result:

require('lme4');
options(contrasts = c("contr.helmert", "contr.poly"));
comp <- as.factor(c("ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","ME","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NO","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN","NN"));
day <- as.factor(c("15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","15d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","2d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d","4d"));
dose <- as.factor(c("h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v","v","h","h","h","h","h","l","l","l","l","l","v","v","v","v"));
y <- c(0.6340123, 0.82483065, 0.5433715, 0.8385864, 1.1798755, 0.96428806, 1.020397, 0.73395425, 0.62003493, 0.89003533, 1.013417, 0.86513805, 0.6507605, 1.269033, 1, 0.71571755, 1.12302, 1.1400104, 1.3155782, 0.73538464, 0.68188137, 0.9961954, 1.469266, 1.2571969, 0.97582996, 1.0580981, 0.97397876, 0.84104455, 1.1569616, 1, 1.4160541, 1.2114259, 1.0771286, 1.3478231, 1.0284914, 1.3815721, 0.8916577, 0.92002803, 1.0798845, 0.78771836, 1.2546788, 1.026139, 0.59879524, 0.9245441, 1, 0.8343771, 0.8411399, 0.9505881, 0.7809184, 0.77748644, 0.7815128, 0.98124343, 0.7885042, 0.9205138, 0.8560785, 0.959222, 1.0715216, 1, 1.0123525, 0.99243677, 1.1392847, 1.1754719, 1.0854151, 1.3116035, 1.1473238, 0.8888626, 1.0498226, 1.1444727, 1.0023673, 1.0880523, 1, 0.9158712, 1.0372487, 1.0371103, 0.95093626, 0.9164175, 0.9699769, 0.7713731, 0.9024502, 0.79071623, 0.8935266, 0.9963459, 0.68743867, 0.80742896, 0.78378457, 1.0544268, 1.0558964, 0.883991, 1, 0.7556594, 1.0331355, 1.0371449, 1.0751379, 0.7835439, 0.9568664, 0.8127074, 1.1559318, 0.8821953, 0.9724431, 1, 0.8879077, 1.0629025, 0.80825365, 1.1357676, 0.8643075, 0.7501826, 0.7690809, 0.7515625, 0.8325848, 0.9322368, 1.0037233, 0.8682108, 0.74939376, 0.84952563, 0.95285666, 1.1123488, 1, 1.1255208, 0.7667759, 0.90020794, 0.58781123, 0.9769909, 1.2353076, 0.51830184, 0.86657614, 0.871735, 0.66517806, 0.9076414, 0.92547095, 0.9695125, 1.0304874, 0.93153405, 1.534189);
fit <- lmer(y ~ dose * day + (1 | comp), verbose=TRUE);


Version of R
> sessionInfo()

R version 2.10.1 Patched (2010-01-12 r50993)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] lme4_0.999375-32   Matrix_0.999375-33 lattice_0.17-26

loaded via a namespace (and not attached):
[1] grid_2.10.1  tools_2.10.1

	[[alternative HTML version deleted]]


