'Loglikelihood for observations of Poisson model
Parameters
params : array-like
The parameters of the model.
Returns
loglike : array-like
The log likelihood for each observation of the model evaluated
at `params`. See Notes
Notes
.. math:: \ln L_{i}=\left[-\lambda_{i}+y_{i}x_{i}^{\prime}\beta-\ln y_{i}!\right]
for observations :math:`i=1,...,n`'

def loglikeobs(self, params):

    offset = getattr(self, 'offset', 0)
    exposure = getattr(self, 'exposure', 0)
    XB = ((np.dot(self.exog, params) + offset) + exposure)
    endog = self.endog
    return (((- np.exp(XB)) + (endog * XB)) - gammaln((endog + 1)))
