From negative binomial to Poisson distribution

When the parameter size is +Inf, then dnbinom(x, mu, size=+Inf) is similar to dpois(x, lambda=mu):

> dnbinom(1:20, mu=5, size=+Inf)
 [1] 3.368973e-02 8.422434e-02 1.403739e-01 1.754674e-01 1.754674e-01 1.462228e-01
 [7] 1.044449e-01 6.527804e-02 3.626558e-02 1.813279e-02 8.242177e-03 3.434240e-03
[13] 1.320862e-03 4.717363e-04 1.572454e-04 4.913920e-05 1.445271e-05 4.014640e-06
[19] 1.056484e-06 2.641211e-07
> dpois(1:20, lambda =5)
 [1] 3.368973e-02 8.422434e-02 1.403739e-01 1.754674e-01 1.754674e-01 1.462228e-01
 [7] 1.044449e-01 6.527804e-02 3.626558e-02 1.813279e-02 8.242177e-03 3.434240e-03
[13] 1.320862e-03 4.717363e-04 1.572454e-04 4.913920e-05 1.445271e-05 4.014640e-06
[19] 1.056484e-06 2.641211e-07

This is logical from the definition of variance of negative binomial distribution:

variance = mu + mu^2 / size

When size is +Inf, variance is mu... and then negative binomial is a Poisson distribution.

Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04