## models.DoubleGlm


A double GLM: a GLM for the mean and a gamma GLM with the log link for


Usage

``` python
models.DoubleGlm()
```


the dispersion, each on its own design, as R's `dglm` with its mean step's weights corrected.


## Parameters


`family: str`  
`"gaussian"`, `"poisson"`, `"gamma"` or `"tweedie"`.

`link: str`  
The mean's link; by default the log link for the gamma, inverse Gaussian and Tweedie, the canonical link otherwise.

`power: float`  
The Tweedie's power, in (1, 2).

`method: str`  
`"ml"` (the default, as `dglm`) or `"reml"`.

`link_power: float`  
The power link's exponent.


## Examples

``` python
>>> from prospicio.models import Design, DoubleGlm
>>> urban = [0.0] * 4 + [1.0] * 4
>>> d = Design([[1.0] * 8, urban], ["(Intercept)", "urban"])
>>> y = [9.0, 11.0, 10.0, 10.5, 4.0, 18.0, 6.0, 15.0]
>>> fit = DoubleGlm("gamma", link="log").fit(d, d, y)
>>> fit.dispersion_coefficients[1] > 0
```

True


## Methods

| Name | Description |
|----|----|
| [fit()](#fit) | Fits the mean on [mean](esg.Cir.md#prospicio.esg.Cir.mean) (its offset and prior weights apply) and |

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


#### fit()


Fits the mean on [mean](esg.Cir.md#prospicio.esg.Cir.mean) (its offset and prior weights apply) and


Usage

``` python
fit(mean, dispersion, y)
```


the log dispersion on [dispersion](models.GlmFit.md#prospicio.models.GlmFit.dispersion) (its offset applies).


##### Returns


`DoubleGlmFit`
