## models.NegativeBinomialGlm


A negative binomial GLM with its [theta](models.TwoPartFit.md#prospicio.models.TwoPartFit.theta) estimated with the


Usage

``` python
models.NegativeBinomialGlm()
```


coefficients by maximum likelihood, as R's `MASS::glm.nb`: IRLS and Newton's method on [theta](models.TwoPartFit.md#prospicio.models.TwoPartFit.theta) alternate until both settle.


## Parameters


`link: str = ``"log"`  


## Examples

``` python
>>> 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()](#fit) | Fits [theta](models.TwoPartFit.md#prospicio.models.TwoPartFit.theta) and the coefficients. |

------------------------------------------------------------------------


#### fit()


Fits [theta](models.TwoPartFit.md#prospicio.models.TwoPartFit.theta) and the coefficients.


Usage

``` python
fit(design, y)
```


##### Returns


`NegativeBinomialFit`
