Binomial.resid_dev()

statsmodels.genmod.families.family.Binomial.resid_dev

Binomial.resid_dev(endog, mu, scale=1.0) [source]

Binomial deviance residuals

Parameters:

endog : array-like

Endogenous response variable

mu : array-like

Fitted mean response variable

scale : float, optional

An optional argument to divide the residuals by scale. The default is 1.

Returns:

resid_dev : array

Deviance residuals as defined below

Notes

If the endogenous variable is binary:

resid\_dev_i = sign(Y_i - \mu_i) * \sqrt{-2 *
               \log(I_{1,i} * \mu_i + I_{0,i} * (1 - \mu_i))}

where I_{1,i} is an indicator function that evalueates to 1 if Y_i = 1. and I_{0,i} is an indicator function that evaluates to 1 if Y_i = 0.

If the endogenous variable is binomial:

resid\_dev_i = sign(Y_i - \mu_i) \sqrt{2 * n_i *
               (Y_i * \log(Y_i / \mu_i) + (1 - Y_i) *
               \log(1 - Y_i)/(1 - \mu_i))}

where Y_i and n are as defined in Binomial.initialize.

© 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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部