'convergence check for iterative estimation'

def cont(self, ML=False, rtol=1e-05, params_rtol=1e-05, params_atol=0.0001):

    (self.dev, old) = (self.deviance(ML=ML), self.dev)
    self.history['llf'].append(self.dev)
    self.history['params'].append(self.a.copy())
    self.history['D'].append(self.D.copy())
    if (np.fabs(((self.dev - old) / self.dev)) < rtol):
        self.termination = 'llf'
        return False
    if np.all((np.abs((self.a - self._a_old)) < ((params_rtol * self.a) + params_atol))):
        self.termination = 'params'
        return False
    self._a_old = self.a.copy()
    return True
