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

def nloglikeobs(self, params):

    XB = (self.offset + np.dot(self.exog, params))
    endog = self.endog
    nloglik = ((np.exp(XB) - (endog * XB)) + np.log(factorial(endog)))
    return nloglik
