Skip to main content

models.NegativeBinomialGlm

A negative binomial GLM with its theta estimated with the

Usage

Source

models.NegativeBinomialGlm()

coefficients by maximum likelihood, as R’s MASS::glm.nb: IRLS and Newton’s method on theta alternate until both settle.

Parameters

link: str = "log"

Examples

>>> from prospicio.models import Design, NegativeBinomialGlm
>>> x = [float(i % 3) for i in range(60)]
>>> y = [float((i * 7) % 11) for i in range(60)]
>>> fit = NegativeBinomialGlm().fit(Design([[1.0] * 60, x], ["(Intercept)", "x"]), y)
>>> fit.theta > 0 and fit.se_theta > 0

True

Methods

Name Description
fit() Fits theta and the coefficients.

fit()

Fits theta and the coefficients.

Usage

Source

fit(design, y)
Returns
NegativeBinomialFit