'Parameters
params : tuple, (mu, ar, ma)
try to keep the params conversion in loglike
copied from generate_gjrgarch
needs to be extracted to separate function'

def geterrors(self, params):

    (ar, ma) = params
    eta = self.endog
    nobs = eta.shape[0]
    etax = np.empty((nobs, 3))
    etax[:, 0] = 1
    etax[:, 1:] = (eta ** 2)[:, None]
    etax[((eta > 0), 2)] = 0
    h = miso_lfilter(ar, ma, etax, useic=np.atleast_1d(etax[:, 1].mean()))[0]
    hneg = (h < 0)
    if hneg.any():
        h = np.abs(h)
    err = (np.sqrt(h) * eta)
    return (err, h, etax)
