statsmodels.genmod.families.family.Tweedie.resid_anscombe

Tweedie.resid_anscombe(endog, mu, var_weights=1.0, scale=1.0)[source]

The Anscombe residuals

Parameters:
endogndarray

The endogenous response variable

mundarray

The inverse of the link function at the linear predicted values.

var_weightsarray_like

1d array of variance (analytic) weights. The default is 1.

scalefloat, optional

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

Returns:
resid_anscombendarray

The Anscombe residuals as defined below.

Notes

When p=3, then

resid_anscombei=log(endogi/μi)/μiscale(var_weights)

Otherwise,

c=(3p)/3
resid_anscombei=(1/c)(endogicμic)/μip/6/scale(var_weights)