'Loglikelihood for arma model
Notes
The ancillary parameter is assumed to be the last element of
the params vector'

def loglike(self, params):

    errorsest = self.geterrors(params)
    sigma2 = np.maximum((params[(-1)] ** 2), 1e-06)
    axis = 0
    nobs = len(errorsest)
    llike = ((-0.5) * (((nobs * np.log(sigma2)) + np.sum(((errorsest ** 2) / sigma2), axis)) + (nobs * np.log((2 * np.pi)))))
    return llike
