The Negative Binomial (NB) you’re using (as implemented by MASS::glm.nb()) is parameterized by two quantities:
- μ = expected count (mean)
- θ (often called size or dispersion parameter) > 0
🔢 Probability Mass Function (PMF)
For y=0,1,2,…, the NB‑2 PMF (MASS’s “size–mu” parameterization) is
P(Y=y)=Γ(θ)y!Γ(y+θ)(θ+μθ)θ(θ+μμ)y.
- Γ(⋅) = gamma function
- θ/(θ+μ) = probability of “failure”
- μ/(θ+μ) = probability of “success”
📈 Mean & Variance
E[Y]=μ,Var(Y)=μ+θμ2.
Because θμ2≥0, Var(Y) ≥ μ, making NB inherently a over‑dispersed generalization of Poisson.
📊 Role of θ
θ (size) | Interpretation | Var(Y) relative to μ |
---|
→∞ | Gamma mixing variance → 0 | Var ≈ μ (Poisson limit) |
large (≫μ) | Weak overdispersion | Var slightly > μ |
small (≪μ) | Strong overdispersion | Var ≫ μ |
- θ is the shape parameter of the Gamma distribution in the Poisson–Gamma mixture view:
- Draw λ∼Gamma(shape=θ,scale=μ/θ)
- Then Y∣λ∼Poisson(λ)
⚠️ Why θ>0?
- Gamma(shape=θ) is only defined for θ>0
- Ensures PMF integrates to 1
- Guarantees Var(Y) ≥ μ (no underdispersion)
If θ→∞, NB “degenerates” to Poisson; if θ is very small, variance blows up (extreme overdispersion).