NegativeBinomial#
- class superglm.NegativeBinomial(theta: float | str)#
Bases:
objectNegative binomial (NB2) family with overdispersion controlled by
theta.- Parameters:
- thetafloat or “auto”
Overdispersion parameter (>0). Larger theta = less overdispersion. As theta -> inf, approaches Poisson. Pass
"auto"to estimate theta via profile likelihood duringfit().
- variance(
- mu: NDArray,
V(μ) = μ + μ²/θ.
- variance_derivative(
- mu: NDArray,
V’(μ) = 1 + 2μ/θ.
- variance_second_derivative(
- mu: NDArray,
V’’(μ) = 2/θ. Wood (2011) Appendix D.
- deviance_unit(
- y: NDArray,
- mu: NDArray,
NB2 unit deviance.