[R-sig-ME] more on nbinom1 vs 2

Don Cohen don-|me4 @end|ng |rom |@|@@c@3-|nc@com
Fri Oct 23 03:40:39 CEST 2020


I'm still hoping to see some reaction to my message of 10-16
on aggregation of count data.

In the mean while, here's an attempt to explain something related.  
I'm again hoping for feedback - is this all correct, am I missing 
something important?

I now think I (finally) understand that nbinom1 is really the SAME 
distribution as nbinom2.  How well a set of values fits a single NB
distribution has nothing to do with whether the distribution is
described by the parameters of nbinom1 or those of nbinom2.
It is a set of different NB distributions that can fit one better
than the other, and most models actually do predict a set of 
distributions rather than just one.  In particular, if there
are covariates, then a different distribution is predicted for
each value of the covariates.

If there are no covariates, then there should be no difference 
between nbinom1 and nbinom2, except for different overdispersion
parameters predicting the same variance.  (This variance is 
presumably observed in the different result values.)

Getting rid of covariates, 
if glmmTMB(result~1,family=nbinom1,data=D) says

 Overdispersion parameter for nbinom1 family (): x
 with (Intercept) y

while glmmTMB(result~1,family=nbinom2,data=D) says

 Overdispersion parameter for nbinom2 family (): z
 with (Intercept) w

then y better be the same as w, since the mean would be 
exp(y) in the first case and exp(w) in the second.
Similarly the variance would be
 mean * (1 + param) = exp(y) * (1+x) in the first case and
 mean * (1 + (mean/param)) = exp(w) * (1+ (exp(w)/z)) in the second.
which again should be the same value.

This was indeed what I found when I tried it.
This remained true when I added an offset: result~offset(log(exposure))

However, when I added a random effect: result ~ (1|group)
I was surprised to get different results for nbinom1 and nbinom2, i.e.,
different AIC and different intercept.  
I also noticed a difference in the variance of the random effect.

I now think I understand why.  The random effect allows different
means and variances for different groups, and this (unlike any 
previous examples) can agree with nbinom1 better or worse than 
nbinom2, depending on whether the relation between the means and 
variances of the groups is closer to linear or quadratic.

Perhaps I should stop here and wait for replies before moving
on to how this is related to the aggregation issue in the
earlier message.



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