6
$\begingroup$

If we do a negative binomial GLM with unknown deviance, a frequent strategy (used for example by glm.nb in package MASS in R) is to use a Gibbs sampler:

  1. Hold dispersion fixed, estimate the mean
  2. Hold mean fixed, estimate the dispersion

Isn't the mean the same than that would be guessed by Poisson regression? If so, why bother with the Gibbs sampler? Why not just fit the mean using Poisson, then fit the dispersion?

$\endgroup$

1 Answer 1

1
$\begingroup$

It's not the same but it can be close. In this example, offset and exponent are less than $10^{-3}$ apart between the poisson and negative binomial estimate. The Poisson dispersion estimate is 1.08, while the negative binomial is 1.09 example plot

R code:

library(ggplot2)
library(data.table)
library(MASS)

data=data.table(x=1:100)
data[,mu:=5*x]
data[,y:=rnbinom(100, mu = mu, size=1)]

lmp=glm(y~log(x),data=data,family=poisson(link="log"))
data[,pred.poisson:=predict(lmp,type="response")]
disp.pois=data[,theta.ml(y,mu,.N)]

lmnb=glm.nb(y~log(x), data=data, link="log")
data[,pred.nb:=predict(lmnb,type="response")]

ggplot(data)+geom_point(aes(x,y))+geom_line(aes(x,mu,colour="true mean"))+
  geom_line(aes(x,pred.poisson,colour="poisson"))+
  geom_line(aes(x,pred.nb,colour="nb"))
$\endgroup$
2
  • 2
    $\begingroup$ I fail to understand how this answers the question. $\endgroup$
    – SmallChess
    Sep 14, 2016 at 9:13
  • $\begingroup$ it's a practical example that final inferences are different but close, what else can I tell you? Feel free to write something better. $\endgroup$
    – yannick
    Sep 14, 2016 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.