Skip to content
Prev 18383 / 20628 Next

nAGQ > 1 in lme4::glmer gives unexpected likelihood

The nAGQ setting doesn't affect the constant in question, but rather how
accurately the deviance is evaluated. *Very coarsely*, think of nAGQ as
impacting how much "rounding" you do at intermediate steps. (It's more
complicated than that, but the general intuition is not completely off.)
So for a lot of models, changing that setting won't have much of an
impact, but there could be some situations where that setting matters more.

The "off by a constant" issue is for the deviance and not the log
likelihood per se. While we often think of the deviance as just being -2
log likelihood, that's a very special case for the "easy" models you
learn in intro to stats (like the classical fixed-effects linear
regression). The term "deviance" actually comes the fact that it
describes the "deviation" in fit (as measured by log likelihood) from a
fully saturated model, which is relatively easy to define for classical LM.

Like so many obvious and easy things from classical regression, there is
no obvious and easy equivalent in the GLMM world. (GLM breaks things
from LM, and LMM breaks things from LM, GLMM just breaks soooo much.)
However, because we usually care about differences of deviance, this
doesn't matter too much -- the additive constant just cancels out.
Likewise, it doesn't matter for treating deviance as the objective in an
optimization problem.

This is then the problem with different types of "deviance". Like the
log likelihood, the deviance is uniquely defined for a given probability
model (if we only know what the saturated model is). So we can talk
about the deviance of an unconditional or conditional model, but it's a
little bit problematic to talk about the "unconditional deviance",
although I understand the temptation to use that as a convenient shorthand.

I've simplified a bit and I'm hoping that I've cleared up more
inaccuracies than I've created, lest the stats deities smite me ....

Phillip
On 25/04/2020 16:41, Vaida, Florin wrote: