statsmodels.genmod.families.family.Binomial.resid_anscombe¶
-
Binomial.resid_anscombe(endog, mu, var_weights=
1.0
, scale=1.0
)[source]¶ The Anscombe residuals
- Parameters:¶
- endog
ndarray
The endogenous response variable
- mu
ndarray
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 argument to divide the residuals by sqrt(scale). The default is 1.
- endog
- Returns:¶
- resid_anscombe
ndarray
The Anscombe residuals as defined below.
- resid_anscombe
Notes
where cox_snell is defined as cox_snell(x) = betainc(2/3., 2/3., x)*betainc(2/3.,2/3.) where betainc is the incomplete beta function as defined in scipy, which uses a regularized version (with the unregularized version, one would just have
).The name ‘cox_snell’ is idiosyncratic and is simply used for convenience following the approach suggested in Cox and Snell (1968). Further note that
where hyp2f1 is the hypergeometric 2f1 function. The Anscombe residuals are sometimes defined in the literature using the hyp2f1 formulation. Both betainc and hyp2f1 can be found in scipy.References
- Anscombe, FJ. (1953) “Contribution to the discussion of H. Hotelling’s
paper.” Journal of the Royal Statistical Society B. 15, 229-30.
- Cox, DR and Snell, EJ. (1968) “A General Definition of Residuals.”
Journal of the Royal Statistical Society B. 30, 248-75.