[R-sig-ME] new version of lme4 - Log-Likelihood of model returned as "-Inf"

Ben Bolker bbolker at gmail.com
Thu Feb 13 01:36:03 CET 2014


  On the other hand, this example doesn't replicate the problem (it uses
lme4 1.1-4, which has a "simulate from scratch" functionality ...)

library(lme4)
d <- expand.grid(fac1=LETTERS[1:2],fac2=letters[1:2],grp=factor(1:10),
                 obs=1:10)
d$y <- simulate(~fac1*fac2+(1|grp),family=poisson,
         newdata=d,newparams=list(beta=c(2,1,-1,-1),theta=c(1)))[[1]]
d <- transform(d,y=ifelse(fac1=="A" & fac2=="b",0,y))
g1 <- glmer(y~fac1*fac2+(1|grp),family=poisson,data=d)
logLik(g1)

this gives convergence warnings and large values of the fixed effect
parameters (+/- 20), but a finite log-likelihood and parameters (the
MLEs *should* be infinite, but the algorithm can't get there ...)


## simulated value of y
y <- c(12, 29, 0, 6, 21, 92, 0, 10, 4, 21, 0, 3, 7, 23, 0, 2, 3, 8,
0, 0, 12, 37, 0, 9, 1, 9, 0, 0, 2, 9, 0, 0, 43, 103, 0, 15, 26,
53, 0, 4, 7, 29, 0, 6, 21, 80, 0, 10, 4, 12, 0, 0, 5, 22, 0,
5, 3, 3, 0, 1, 14, 34, 0, 4, 3, 7, 0, 1, 4, 4, 0, 0, 34, 92,
0, 17, 30, 51, 0, 7, 12, 30, 0, 8, 22, 73, 0, 10, 4, 18, 0, 2,
10, 25, 0, 2, 2, 8, 0, 2, 13, 23, 0, 5, 4, 9, 0, 1, 5, 8, 0,
1, 45, 123, 0, 14, 27, 52, 0, 11, 3, 27, 0, 0, 31, 70, 0, 10,
12, 17, 0, 1, 10, 18, 0, 1, 8, 9, 0, 1, 13, 35, 0, 6, 3, 7, 0,
0, 2, 8, 0, 2, 38, 108, 0, 9, 29, 54, 0, 6, 13, 24, 0, 5, 22,
68, 0, 13, 4, 17, 0, 1, 12, 22, 0, 3, 3, 7, 0, 3, 17, 22, 0,
6, 4, 9, 0, 0, 4, 8, 0, 0, 32, 103, 0, 23, 26, 75, 0, 9, 14,
26, 0, 2, 37, 72, 0, 8, 4, 19, 0, 0, 8, 11, 0, 4, 1, 4, 0, 1,
8, 39, 0, 4, 4, 11, 0, 0, 2, 6, 0, 1, 38, 112, 0, 16, 23, 70,
0, 9, 10, 27, 0, 6, 28, 65, 0, 7, 8, 14, 0, 2, 11, 21, 0, 1,
1, 7, 0, 0, 11, 30, 0, 5, 3, 11, 0, 1, 3, 7, 0, 2, 34, 113, 0,
17, 23, 63, 0, 6, 16, 35, 0, 3, 20, 78, 0, 8, 6, 16, 0, 2, 7,
25, 0, 2, 2, 5, 0, 0, 13, 37, 0, 5, 2, 11, 0, 1, 8, 6, 0, 2,
36, 107, 0, 14, 22, 74, 0, 6, 14, 24, 0, 5, 40, 73, 0, 7, 11,
21, 0, 7, 9, 22, 0, 3, 5, 4, 0, 1, 10, 35, 0, 5, 2, 7, 0, 3,
3, 12, 0, 0, 41, 118, 0, 17, 21, 59, 0, 5, 9, 31, 0, 6, 26, 63,
0, 6, 5, 25, 0, 1, 6, 30, 0, 3, 4, 9, 0, 3, 12, 32, 0, 8, 5,
11, 0, 0, 1, 14, 0, 0, 40, 89, 0, 13, 16, 58, 0, 11)
On 14-02-12 06:14 PM, juwb08 at hampshire.edu wrote:
> 
> ... the dataset failed to attach, so here it is.
> Sorry!
> 
> Quoting juwb08 at hampshire.edu:
> 
>> Hi All,
>>
>> I was working with Poisson glmms in lme4 last year in 2013 using
>> Windows XP, lme4 version 0.999375-16 (2008-06-23) and R version 2.15.1
>> (2012-06-22), evaluating a set of candidate models with AIC to select
>> the best ones.
>>
>> This worked well until I updated lme4 and R last month.
>>
>> I now updated to R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" and
>> lme4 version 1.0-5 (2013-10-24), still Windows XP, and am running the
>> same models again on the same data, and lme4 now returns "-Inf" for
>> the log likelihood, so it can't calculate AIC.
>>
>> Using the previous versions, I got stable values for Log-Likelihoods
>> and calculated AICs with them.
>>
>> Attached is a sample of the dataset and the code I am using.
>>
>> How can I get a Log-Likelihood estimate with the current versions of
>> lme4 and R?
>>
>> Thanks in advance.
>> Justin Baldwin
>>
>> Hampshire College, MA, USA
> 
> 
> 
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



More information about the R-sig-mixed-models mailing list