W3cubDocs

/Statsmodels

statsmodels.genmod.families.family.Binomial.resid_dev

Binomial.resid_dev(endog, mu, var_weights=1.0, scale=1.0)

The deviance residuals

Parameters:
  • endog (array-like) – The endogenous response variable
  • mu (array-like) – The inverse of the link function at the linear predicted values.
  • var_weights (array-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 – Deviance residuals as defined below.

Return type:

float

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.

© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.genmod.families.family.Binomial.resid_dev.html