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

Deviance of (endog,mu) pair.

Deviance is usually defined as twice the loglikelihood ratio.


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


Deviance : array

The value of deviance function defined below.


Deviance is defined

\sum_i(2 loglike(y_i, y_i) - 2 * loglike(y_i, mu_i)) / scale

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