Skip to content
Prev 18738 / 20628 Next

Loglik of model with maxfun = 0 is not the one expected

This is a perfectly reasonable, and an unexpectedly difficult, 
problem.  The glmer-fitting machinery has a lot of internal state that 
is hard to set exactly right.

   In this particular case, adding 
nAGQ0initStep=FALSE to glmerControl() works [it disables the first-stage 
optimization step; presumably at some point during this step, or the 
pre- and post-processing surrounding it, the GLMM likelihood evaluation 
is called and messes up the internal state)

Here is another way to reproduce the log-likelihood:

m3 <- update(m1, devFunOnly=TRUE)
-0.5*m3(c(theta,beta))

The development version of lme4 will also allow

-0.5*getME(m1,"devfun")(c(theta,beta))

(the internal code is more efficient and self-contained than the 
update(., "devFunOnly") version)
On 9/28/20 4:25 PM, Marc Girondot via R-sig-mixed-models wrote: