What does CUSUM Alarms conclude, in numbers, about “The Sluggish Red Line: at Equal False-Alarm Rates the CUSUM Is Several Times Faster”?

Answer: Chapter 1 shows that, with the same budget of one false alarm in 370 days, a drift of half a standard deviation is found by a fixed threshold after 88.9 days on average and by a CUSUM after 27.7 days, a ratio of 3.21; for a large jump of three standard deviations the ratio reverses to 0.76.

Scope of the numbers: Parameters are illustrative; all calculations are generated by the book's programs; the book is general business analysis, not individualised business advice, and Chapter 8 is an offline model that reads no server. Marked boxes separate published evidence, runnable Python calculations (23 programs), classical sources and the author's hypotheses.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.76, 27.7, 3.21, 88.9

k = 0.50, h = 4.096, CUSUM ARL0 = 370.0
fixed threshold L = 2.782, ARL0 = 370.0
shiftfixed ARLCUSUM ARLratio
0.25176.381.92.15
0.5088.927.73.21
0.7547.413.63.48
1.0026.78.63.12
1.5010.04.82.07
2.004.63.41.35
3.001.72.20.76
4.001.11.70.65
Show the full program
# Chapter 1. p12: CUSUM against a fixed threshold at one false-alarm rate.
# Model: z ~ N(delta, 1); upper CUSUM S = max(0, S + z - k), alarm when
# S > h. ARL comes from the Brook and Evans (1972) Markov chain: [0, h]
# is cut into m cells, the transition matrix R is built from the normal
# CDF and (I - R) L = 1 is solved by hand-written Gaussian elimination.
# h is chosen so that ARL0 = 370, the same in-control ARL as the fixed
# threshold of p11 (L is solved again here). k = 0.5 is the textbook
# choice tuned to a one-sigma shift; all shifts are illustrative.
import math


def cdf(x):
    return 0.5 * math.erfc(-x / math.sqrt(2.0))


def upper(x):
    return 0.5 * math.erfc(x / math.sqrt(2.0))


def solve(a, b):
    # Gaussian elimination with partial pivoting; back substitution
    # adds its terms with math.fsum
    n = len(b)
    m = [list(row) + [b[i]] for i, row in enumerate(a)]
    for p in range(n):
        q = max(range(p, n), key=lambda r: abs(m[r][p]))
        m[p], m[q] = m[q], m[p]
        piv = m[p]
        for r in range(p + 1, n):
            f = m[r][p] / piv[p]
            if f != 0.0:
                m[r] = m[r][:p] + [x - f * y for x, y in
                                   zip(m[r][p:], piv[p:])]
    x = [0.0] * n
    for i in range(n - 1, -1, -1):
        s = math.fsum(m[i][j] * x[j] for j in range(i + 1, n))
        x[i] = (m[i][n] - s) / m[i][i]
    return x


def arl(k, h, delta, m=80):
    w = 2.0 * h / (2 * m - 1)
    a = []
    for i in range(m):
        c = i * w - k + delta
        row = [-cdf(w / 2.0 - c)]
        for j in range(1, m):
            row.append(cdf(j * w - w / 2.0 - c)
                       - cdf(j * w + w / 2.0 - c))
        row[i] = row[i] + 1.0
        a.append(row)
    return solve(a, [1.0] * m)[0]


def limit_for(arl0):
    lo, hi = 0.0, 10.0
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if upper(mid) > 1.0 / arl0:
            lo = mid
        else:
            hi = mid
    return 0.5 * (lo + hi)


def h_for(k, target, m=80):
    lo, hi = 0.5, 12.0
    for _ in range(40):
        mid = 0.5 * (lo + hi)
        if arl(k, mid, 0.0, m) < target:
            lo = mid
        else:
            hi = mid
    return 0.5 * (lo + hi)


if __name__ == "__main__":
    k, L = 0.5, limit_for(370.0)
    h = h_for(k, 370.0)
    print("k = {:.2f}, h = {:.3f}, CUSUM ARL0 = {:.1f}".format(
        k, h, arl(k, h, 0.0)))
    print("fixed threshold L = {:.3f}, ARL0 = {:.1f}".format(
        L, 1.0 / upper(L)))
    print(" shift   fixed ARL   CUSUM ARL   ratio")
    for d in (0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 4.0):
        f = 1.0 / upper(L - d)
        c = arl(k, h, d)
        print(" {:5.2f}  {:9.1f}  {:10.1f}  {:6.2f}".format(d, f, c, f / c))

Single source and citation

Fan, Y. (2026). CUSUM Control Charts and Average Run Length: the Fastest Alarm within a False-Alarm Budget for Latency Drift and Silent Conversion Drops (Version 1.0.0), Chapter 1: The Sluggish Red Line: at Equal False-Alarm Rates the CUSUM Is Several Times Faster. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-305 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026305,
  author    = {Fan, Yafu},
  title     = {CUSUM Control Charts and Average Run Length: the Fastest Alarm within a False-Alarm Budget for Latency Drift and Silent Conversion Drops},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book