关于「参考值与告警限的设计表:猜错漂移与估错基线的代价」,《累积和告警》给出的定量结论是什么?
结论:再看均值。用 14 天做基线,均值的标准误是 0.267 个标准差;若均值恰好估低了一个标准误,误报间隔只剩 74.9 天,大约两个半月一次;若估高了一个标准误,误报间隔变成 2646.6 天,小幅漂移要很久才能被发现。用 30 天做基线,两个方向分别是 118.2 天和 1377.3 天;用 90 天,分别是 186.7 天和 776.5 天;即使用满一年 365 天,也还有 261.4 天到 531.1 天的摆动。
数据口径:书中参数为示意;全部计算由书中程序生成;本书属于非个人化经营建议,第八章只做离线模型,不访问任何服务器。 书中以标注框区分已发表的证据、可运行的 Python 计算(23 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.267, 118.2, 1377.3, 14, 186.7, 261.4
| sigma ratio r ARL0 | |
| 0.90 | 180.1 |
| 0.95 | 255.6 |
| 1.00 | 369.9 |
| 1.05 | 546.6 |
| 1.10 | 825.1 |
| baseline days | 1 s.e. ARL0(mean low) ARL0(mean high) |
| 14 | 0.267 74.9 2646.6 |
| 30 | 0.183 118.2 1377.3 |
| 90 | 0.105 186.7 776.5 |
| 365 | 0.052 261.4 531.1 |
查看完整验算程序
# Chapter 5. p53: what an estimated baseline does to the false-alarm rate.
# Model: readings are standardised with a baseline mean and sigma taken
# from n past days. If the estimated mean is too low by e (in sigma) or
# the estimated sigma is a fraction r of the true one, the standardised
# readings are N(e / r, 1 / r^2) instead of N(0, 1). The chain of p12 is
# rebuilt with that mean and spread (k = 0.5, h = 4.096, m = 60). The
# standard error of a baseline mean is 1 / sqrt(n) (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, mu, sd, m=60):
w = 2.0 * h / (2 * m - 1)
a = []
for i in range(m):
c = i * w - k + mu
row = [-cdf((w / 2.0 - c) / sd)]
for j in range(1, m):
row.append(cdf((j * w - w / 2.0 - c) / sd)
- cdf((j * w + w / 2.0 - c) / sd))
row[i] = row[i] + 1.0
a.append(row)
return solve(a, [1.0] * m)[0]
if __name__ == "__main__":
k, h = 0.5, 4.096
print("sigma ratio r ARL0")
for r in (0.9, 0.95, 1.0, 1.05, 1.1):
print(" {:5.2f} {:7.1f}".format(r, arl(k, h, 0.0, 1.0 / r)))
print("baseline days 1 s.e. ARL0(mean low) ARL0(mean high)")
for n in (14, 30, 90, 365):
e = 1.0 / math.sqrt(n)
print(" {:4d} {:.3f} {:9.1f} {:9.1f}".format(
n, e, arl(k, h, e, 1.0), arl(k, h, -e, 1.0)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《累积和控制图与平均运行长度、延迟漂移与转化暗降的最快无误报告警母典》第 5 章「参考值与告警限的设计表:猜错漂移与估错基线的代价」(版本 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}
}