7.2.3.3.1.1. statsmodels.genmod.families.family.Family.deviance

Family.deviance(endog, mu, scale=1.0)[source]

Deviance of (endog,mu) pair.

Deviance is usually defined as twice the loglikelihood ratio.

Parameters:

endog : array-like

The endogenous response variable

mu : array-like

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

scale : float, optional

An optional scale argument

Returns:

Deviance : array

The value of deviance function defined below.

Notes

Deviance is defined

i(2loglike(yi,yi)2loglike(yi,mui))/scale

where y is the endogenous variable. The deviance functions are analytically defined for each family.