关于「西格蒙德近似与洛登下界:检测延迟只随误报间隔的对数增长」,《累积和告警》给出的定量结论是什么?
结论:每个观测的信息量是 0.125。误报间隔每扩大十倍,累积和的延迟依次增加 16.2、18.1、18.4 天,逐渐逼近下界的斜率,即十的自然对数除以信息量,等于 18.4 天。固定阈值则完全是另一种增长方式:误报间隔每扩大十倍,它的延迟乘以 7.1、7.5、7.7 倍。误报间隔为十万天时,累积和平均 67.5 天报警,固定阈值要 12003.2 天。
数据口径:书中参数为示意;全部计算由书中程序生成;本书属于非个人化经营建议,第八章只做离线模型,不访问任何服务器。 书中以标注框区分已发表的证据、可运行的 Python 计算(23 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.125, 12003.2, 16.2, 18.1, 18.4, 67.5
| ARL0 h CUSUM ARL1 fixed ARL1 log(ARL0)/I | |
| 100 | 4.415 14.8 29.5 36.8 |
| 1000 | 8.582 31.1 208.5 55.3 |
| 10000 | 13.109 49.1 1554.8 73.7 |
| 100000 | 17.703 67.5 12003.2 92.1 |
| information per reading I | 0.125 |
| CUSUM delay added per tenfold ARL0 | 16.2, 18.1, 18.4 |
| slope of the bound, ln(10) / I | 18.4 |
| fixed threshold delay ratio per tenfold ARL0 | 7.1, 7.5, 7.7 |
查看完整验算程序
# Chapter 4. p43: delay grows with the log of the false-alarm interval.
# Model: for a shift of delta = 0.5 the CUSUM uses k = delta / 2 = 0.25,
# h from Siegmund's formula (p41) for each ARL0; its ARL1 is then taken
# from the Brook and Evans chain (m = 80). The fixed threshold uses L
# with P(Z > L) = 1 / ARL0. Lorden's (1971) asymptote for the best
# possible delay is log(ARL0) / I, with I = delta^2 / 2 the information
# per reading (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 siegmund(k, h, delta):
# Siegmund (1985): b = h + 1.166, D = delta - k
b = h + 1.166
d = delta - k
if abs(d) < 1e-12:
return b * b
return (math.exp(-2.0 * d * b) + 2.0 * d * b - 1.0) / (2.0 * d * d)
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_siegmund(k, target):
lo, hi = 0.0, 60.0
for _ in range(100):
mid = 0.5 * (lo + hi)
if siegmund(k, mid, 0.0) < target:
lo = mid
else:
hi = mid
return 0.5 * (lo + hi)
if __name__ == "__main__":
d = 0.5
k = d / 2.0
info = d * d / 2.0
print(" ARL0 h CUSUM ARL1 fixed ARL1 log(ARL0)/I")
cs = []
for a0 in (100.0, 1000.0, 10000.0, 100000.0):
h = h_siegmund(k, a0)
c = arl(k, h, d)
f = 1.0 / upper(limit_for(a0) - d)
cs.append((c, f))
print(" {:6.0f} {:6.3f} {:9.1f} {:10.1f} {:10.1f}".format(
a0, h, c, f, math.log(a0) / info))
print("information per reading I = {:.3f}".format(info))
steps = [b[0] - a[0] for a, b in zip(cs, cs[1:])]
print("CUSUM delay added per tenfold ARL0: " + ", ".join(
"{:.1f}".format(x) for x in steps))
print("slope of the bound, ln(10) / I = {:.1f}".format(
math.log(10.0) / info))
print("fixed threshold delay ratio per tenfold ARL0: " + ", ".join(
"{:.1f}".format(b[1] / a[1]) for a, b in zip(cs, cs[1:])))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《累积和控制图与平均运行长度、延迟漂移与转化暗降的最快无误报告警母典》第 4 章「西格蒙德近似与洛登下界:检测延迟只随误报间隔的对数增长」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 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}
}