'Notes
Comparing against the cusum6 package for Stata, this does not produce
exactly the same confidence bands (which are produced in cusum6 by
lww, uww) because they use a different method for computing the
critical value; in particular, they use tabled values from
Table C, pp. 364-365 of "The Econometric Analysis of Time Series"
Harvey, (1990), and use the value given to 99 observations for any
larger number of observations. In contrast, we use the approximating
critical values suggested in Edgerton and Wells (1994) which allows
computing relatively good approximations for any number of
observations.'

def _cusum_squares_significance_bounds(self, alpha, points=None):

    llb = self.loglikelihood_burn
    n = ((0.5 * (self.nobs - llb)) - 1)
    try:
        ix = [0.1, 0.05, 0.025, 0.01, 0.005].index((alpha / 2))
    except ValueError:
        raise ValueError('Invalid    significance    level.')
    scalars = _cusum_squares_scalars[:, ix]
    crit = (((scalars[0] / (n ** 0.5)) + (scalars[1] / n)) + (scalars[2] / (n ** 1.5)))
    if (points is None):
        points = np.array([llb, self.nobs])
    line = ((points - llb) / (self.nobs - llb))
    return ((line - crit), (line + crit))
