'Generalized Poisson model derivative of the log-likelihood by p-parameter
Parameters
params : array-like
The parameters of the model
Returns
dldp : float
dldp is first derivative of the loglikelihood function,
evaluated at `p-parameter`.'

def _score_p(self, params):

    if self._transparams:
        alpha = np.exp(params[(-1)])
    else:
        alpha = params[(-1)]
    params = params[:(-1)]
    p = self.parameterization
    exog = self.exog
    y = self.endog[:, None]
    mu = self.predict(params)[:, None]
    mu_p = np.power(mu, p)
    a1 = (1 + (alpha * mu_p))
    a2 = (mu + ((alpha * mu_p) * y))
    dp = np.sum((np.log(mu) * (((a2 - mu) * (((y - 1) / a2) - (2 / a1))) + (((a1 - 1) * a2) / (a1 ** 2)))))
    return dp
