# Method to estimate the prediction interval for GLM and negative binomial distribution

I used a Monte-Carlo approach to estimate the prediction interval for a new observation from a GLM using a Negative Binomial distribution. I used this method for linear models and got reliable estimations of the prediction interval but I am not enough confident with statistics to know if this method could also be applied for non-Gaussian distributions. Could you please tell me if it makes sens to use it or not?

Method:

1. compute the se of the expected value with a Wald approach (on the link).
2. to use this se to randomly simple 1000 values from a Gaussian distribution with the expected value as $\mu$ and se as $\sigma$.
3. for each random value, to randomly sample 1000 values from a negative binomial distribution with the exponential of the random value as mu.
4. The prediction interval was computed as the 2.5 & 97.5 quantile of the 1e6 random values obtained for a given expected value.

Does this methodology makes sense?

Regards, Maxime

-
R code implementing this method appeared in an earlier (now closed) version of this question at stats.stackexchange.com/questions/29889. (+1 for the improved formulation: thanks!) –  whuber Jun 7 '12 at 21:45
After comparing with Bayesian estimates, it appeared that it is also necessary to take into account the distribution of \\theta. –  Maxime Jul 9 '12 at 13:15
(1) What is $\theta$, Maxime? (2) Just how correlated are the estimates of $\mu$ and $\sigma$? Unless the correlation is low, your proposed method--which seems to ignore the correlation altogether--may give misleading results. –  whuber Jul 9 '12 at 13:34
It makes sense if you're taking the $\theta$ as known. If you want to incorporate the uncertainty in $\theta$ you would either simulate from the joint distribution (asymptotically Gaussian) of the other parameters and $\theta$, or you could simulate one conditionally on the other (since $\theta$ is an input to the GLM, I'd suggest simulating $\theta$ from the normal approximation to its profile likelihood and then $\mu$ from the conditional of $\mu$ on $\theta$, since you get that bit of information out of the GLM). Then proceed as above to simulate the negative binomial.