'Poisson model score (gradient) vector of the log-likelihood
Parameters
params : array-like
The parameters of the model
Returns
score : ndarray, 1-D
The score vector of the model, i.e. the first derivative of the
loglikelihood function, evaluated at `params`
Notes
.. math:: \frac{\partial\ln L}{\partial\beta}=\sum_{i=1}^{n}\left(y_{i}-\lambda_{i}\right)x_{i}
where the loglinear model is assumed
.. math:: \ln\lambda_{i}=x_{i}\beta'

def score(self, params):

    offset = getattr(self, 'offset', 0)
    exposure = getattr(self, 'exposure', 0)
    X = self.exog
    L = np.exp(((np.dot(X, params) + offset) + exposure))
    return np.dot((self.endog - L), X)
