Binomial deviance residuals
Parameters: | endog : array-like
mu : array-like
scale : float, optional
|
---|---|
Returns: | resid_dev : array
|
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.