NegativeBinomialLS#

class superglm.NegativeBinomialLS#

Bases: MeanPredictor, ThetaPredictor

Negative-binomial responses with mean and size predictors.

Declare family.mean(...) and family.theta(...). Both use log links. The unit count law has variance mean + mean**2 / theta, so larger theta means less overdispersion. theta is the size parameter in the NB2 parametrization.

Results use the column names mean and theta in that order. family.theta() estimates a constant size; a declaration with terms lets size vary between rows. The observation law for counts or weighted rates follows the model’s weight contract.

See also

SuperLSS

Construct and fit a model with these predictors.

response_boundaries(
links: Sequence[Link],
) → tuple[tuple[str, ...], ...]#

All-zero rows drive the mean to 0 or the size to 0 under log links.

P(Y = 0) = (theta / (theta + mu))^theta tends to one as log mu -> -inf and as log theta -> -inf.