关于「多条规则并行:α 怎么分,转正的规则里几成是空的」,《规则的一生》给出的定量结论是什么?
结论:第六章显示平分 α 给 100 条规则时,无效规则的判决周数只增长 1.12 倍。
数据口径:书中的转化率、流量与每周计数均为示意;全部计算由书中程序生成;本书属非个人化经营方法,不构成经营、法律或投资建议,规则的转正、降级与退役须由主事者人工放行,紧迫感只能来自真实库存与真实截止。 书中以标注框区分已发表的证据、可运行的 Python 计算(20 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 1.12, 100
| rules m | alpha/rule | real alpha | power | wk H0 | wk H1 | fixed wk |
| 1 | 0.05000 | 0.03322 | 0.8714 | 5.83 | 7.71 | 8.86 |
| 5 | 0.01000 | 0.00666 | 0.8709 | 6.29 | 11.69 | 14.19 |
| 10 | 0.00500 | 0.00330 | 0.8747 | 6.45 | 13.53 | 16.46 |
| 20 | 0.00250 | 0.00163 | 0.8745 | 6.49 | 15.30 | 18.70 |
| 40 | 0.00125 | 0.00084 | 0.8744 | 6.51 | 16.96 | 20.94 |
| 100 | 0.00050 | 0.00033 | 0.8744 | 6.52 | 19.31 | 23.88 |
| growth m = 1 to 100 (ratio): H0 1.12, H1 2.51, fixed 2.70 | ||||||
| family false-promotion bound at m = 100: 0.0326 (100 x 0.00033) |
查看完整验算程序
# Chapter 6. p61: splitting alpha across many parallel rules is cheap
# Model: m rules on trial at once; to keep the chance of any false
# promotion near 0.05 the simplest split gives each SPRT alpha/m
# (Bonferroni). We compute exactly, with weekly batches of 600 visitors
# as in p41 (p0 0.03, p1 0.036, beta 0.20), the realised per-rule
# alpha, the power and the mean weeks under H0 and H1, and compare the
# one-sided fixed-sample size at the same alpha and power. Wald's A
# grows like ln(1/alpha) while B barely moves, so null rules, the
# majority of a backlog, are cut almost as fast as before.
import math
from statistics import NormalDist
P0, P1, BETA, M = 0.03, 0.036, 0.20, 600
LA = math.log(P1 / P0)
LB = math.log((1 - P1) / (1 - P0))
N_MAX = 90000
def pmf(p):
hi = min(M, int(M * p + 14 * math.sqrt(M * p * (1 - p))) + 2)
return [math.exp(math.lgamma(M + 1) - math.lgamma(j + 1)
- math.lgamma(M - j + 1) + j * math.log(p)
+ (M - j) * math.log(1 - p)) for j in range(hi + 1)]
def batched(p, alpha):
a = math.log((1 - BETA) / alpha)
b = math.log(BETA / (1 - alpha))
step = pmf(p)
open_k, keep, surv = {0: 1.0}, [], [1.0]
for t in range(1, N_MAX // M + 1):
n = t * M
bins = {}
for k, w in open_k.items():
for j, q in enumerate(step):
bins.setdefault(k + j, []).append(w * q)
open_k = {}
for k in sorted(bins):
mass = math.fsum(bins[k])
llr = k * LA + (n - k) * LB
if llr >= a:
keep.append(mass)
elif llr > b:
open_k[k] = mass
surv.append(math.fsum(open_k.values()))
return math.fsum(keep), math.fsum(surv[:-1])
def n_fixed(alpha):
nd = NormalDist()
za, zb = nd.inv_cdf(1 - alpha), nd.inv_cdf(1 - BETA)
root = math.fsum([za * math.sqrt(P0 * (1 - P0)),
zb * math.sqrt(P1 * (1 - P1))])
return math.ceil((root / (P1 - P0)) ** 2)
print("rules m alpha/rule real alpha power wk H0 wk H1 fixed wk")
base = None
for m in (1, 5, 10, 20, 40, 100):
al = 0.05 / m
a0, w0 = batched(P0, al)
a1, w1 = batched(P1, al)
nf = n_fixed(al) / M
if base is None:
base = (w0, w1, nf)
print("%7d %10.5f %10.5f %6.4f %6.2f %6.2f %8.2f"
% (m, al, a0, a1, w0, w1, nf))
print("growth m = 1 to 100 (ratio): H0 %.2f, H1 %.2f, fixed %.2f"
% (w0 / base[0], w1 / base[1], nf / base[2]))
print("family false-promotion bound at m = 100: %.4f (100 x %.5f)"
% (100 * a0, a0))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《线上规则实证淘汰、序贯概率比检验接入真实转化流与新文案规则转正降级母典》第 6 章「多条规则并行:α 怎么分,转正的规则里几成是空的」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-263 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026263,
author = {Fan, Yafu},
title = {Empirical Retirement of Live Rules: Wiring the Sequential Probability Ratio Test into Real Conversion Streams to Promote, Demote and Retire Copy Rules},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}