'Loglikelihood for timeseries model
Notes
needs to be overwritten by subclass'

def loglike(self, params):

    (p, q) = (self.nar, self.nma)
    ar = np.concatenate(([1], params[:p]))
    ma = np.zeros(((q + 1), 3))
    ma[(0, 0)] = params[(-1)]
    ma[:, 1] = np.concatenate(([0], params[p:(p + q)]))
    ma[:, 2] = np.concatenate(([0], params[(p + q):(p + (2 * q))]))
    mu = params[(-1)]
    params = (ar, ma)
    (errorsest, h, etax) = self.geterrors(params)
    self.params_converted = params
    (self.errorsest, self.h, self.etax) = (errorsest, h, etax)
    sigma2 = np.maximum(h, 1e-06)
    axis = 0
    nobs = len(errorsest)
    axis = 0
    muy = errorsest.mean()
    llike = ((-0.5) * ((np.sum(np.log(sigma2), axis) + np.sum(((self.endog ** 2) / sigma2), axis)) + (nobs * np.log((2 * np.pi)))))
    return llike
