'The deviance function evaluated at (endog,mu,iweights,mu).
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.
iweights : array-like
1d array of weights. The default is 1.
scale : float, optional
An optional scale argument. The default is 1.
Returns
Deviance : array
The value of deviance function defined below.
Notes
Deviance is defined
.. math::
D = 2\sum_i (iweights_i * (llf(Y_i, Y_i) -
llf(Y_i, \mu_i)))
where y is the endogenous variable. The deviance functions are
analytically defined for each family.'

def deviance(self, endog, mu, iweights=1.0, scale=1.0):

    raise NotImplementedError
