statsmodels.genmod.families.family.Tweedie.resid_anscombe

method

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

The Anscombe residuals

Parameters
endogarray

The endogenous response variable

muarray

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_anscombearray

The Anscombe residuals as defined below.

Notes

When \(p = 3\), then

\[resid\_anscombe_i = \log(endog_i / \mu_i) / \sqrt{\mu_i * scale} * \sqrt(var\_weights)\]

Otherwise,

\[c = (3 - p) / 3\]
\[resid\_anscombe_i = (1 / c) * (endog_i^c - \mu_i^c) / \mu_i^{p / 6} / \sqrt{scale} * \sqrt(var\_weights)\]