statsmodels.genmod.families.family.Tweedie.resid_dev¶
- Tweedie.resid_dev(endog, mu, var_weights=1.0, scale=1.0)¶
The deviance residuals
- Parameters:
- endogarray_like
The endogenous response variable
- muarray_like
The inverse of the link function at the linear predicted values.
- var_weightsarray_like
1d array of variance (analytic) weights. The default is 1.
- scale
float
,optional
An optional scale argument. The default is 1.
- Returns:
- resid_dev
float
Deviance residuals as defined below.
- resid_dev
Notes
The deviance residuals are defined by the contribution D_i of observation i to the deviance as
\[resid\_dev_i = sign(y_i-\mu_i) \sqrt{D_i}\]D_i is calculated from the _resid_dev method in each family. Distribution-specific documentation of the calculation is available there.