'weights for score for each observation
This can be considered as score residuals.
Parameters
params : ndarray
parameter at which score is evaluated
scale : None or float
If scale is None, then the default scale will be calculated.
Default scale is defined by `self.scaletype` and set in fit.
If scale is not None, then it is used as a fixed scale.
Returns
score_factor : ndarray_1d
A 1d weight vector used in the calculation of the score_obs.
The score_obs are obtained by `score_factor[:, None] * exog`'

def score_factor(self, params, scale=None):

    mu = self.predict(params)
    if (scale is None):
        scale = self.estimate_scale(mu)
    score_factor = ((self.endog - mu) / self.family.link.deriv(mu))
    score_factor /= self.family.variance(mu)
    score_factor *= self.iweights
    if (not (scale == 1)):
        score_factor /= scale
    return score_factor
