关于「实证闭环:试错预算三线登记表、停损界计算器与预注册方案」,《鞅、停时与商业试错的停损界》给出的定量结论是什么?

结论:第八章给出试错预算三线登记表、小工具「试错停损界计算器」与预注册方案(每组需 601 项试错)。书中以标注框区分已发表的证据、可运行的 Python 计算(21 段程序)、原典与作者的假说。

数据口径:可选停时定理说,只要停止时刻不偷看未来且有上限,不赚不亏的事情在停下时的期望结果就等于起点;示意参数下,「第一次领先就停」的胜率是 0.824,期望却精确为零。 书中参数均为示意;全部计算由书中程序生成。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 601

per trial: stop -3 mean 1.025 sd 5.334; no line mean 0.000 sd 7.211
difference 1.025, pooled sd 6.343, effect size 0.162
normal formula601 trials per arm (two-sided 0.05, power 0.8)
simulated power with 601 per arm0.802
simulated power with 1202 per arm0.981
if the true gain were half as large2404 per arm
查看完整验算程序
# Chapter 8. p82: Sample size for the pre-registered test of the core
# business claim (Chapter 5): with unknown quality, a registered stop
# line earns more per trial than running every trial to its deadline.
# Model as in p51: good p = 0.6 / bad p = 0.4, prior 1/2, deadline 26,
# stop line -3 versus none. Exact means and sds per trial; two-arm
# sample size by the normal formula (two-sided 0.05, power 0.8); then
# a fixed-seed simulation of the planned test. Illustrative.
from fractions import Fraction
import math
import random
import statistics

N, LINE = 26, 3


def outcome_dist(p, b):
    q = 1 - p
    live = {0: Fraction(1)}
    out = {}
    for t in range(1, N + 1):
        new = {}
        for s, pr in live.items():
            new[s + 1] = new.get(s + 1, Fraction(0)) + pr * p
            new[s - 1] = new.get(s - 1, Fraction(0)) + pr * q
        live = {}
        for s in sorted(new):
            if (b is not None and s <= -b) or t == N:
                out[s] = out.get(s, Fraction(0)) + new[s]
            else:
                live[s] = new[s]
    return out


def mixture(b):
    d = {}
    for p in (Fraction(3, 5), Fraction(2, 5)):
        for s, pr in outcome_dist(p, b).items():
            d[s] = d.get(s, Fraction(0)) + pr / 2
    vals = sorted(d)
    mean = math.fsum(s * float(d[s]) for s in vals)
    var = math.fsum((s - mean) ** 2 * float(d[s]) for s in vals)
    return vals, [float(d[s]) for s in vals], mean, math.sqrt(var)


v1, w1, m1, s1 = mixture(LINE)
v0, w0, m0, s0 = mixture(None)
delta = m1 - m0
sd = math.sqrt((s1 * s1 + s0 * s0) / 2)
z = 1.959963984540054 + 0.8416212335729143
n_arm = math.ceil(2 * (z * sd / delta) ** 2)
print("per trial: stop -%d mean %.3f sd %.3f; no line mean %.3f sd %.3f"
      % (LINE, m1, s1, m0, s0))
print("difference %.3f, pooled sd %.3f, effect size %.3f" % (
    delta, sd, delta / sd))
print("normal formula: %d trials per arm (two-sided 0.05, power 0.8)"
      % n_arm)
rng = random.Random(20261182)
for n in (n_arm, 2 * n_arm):
    hits = 0
    for _ in range(4000):
        a = rng.choices(v1, w1, k=n)
        b = rng.choices(v0, w0, k=n)
        se = math.sqrt(statistics.variance(a) / n
                       + statistics.variance(b) / n)
        if abs(statistics.fmean(a) - statistics.fmean(b)) / se > 1.96:
            hits += 1
    print("simulated power with %d per arm: %.3f" % (n, hits / 4000))
print("if the true gain were half as large: %d per arm" % (4 * n_arm))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《杜布鞅论可选停时定理、加倍追注谬误与商业试错见好就收停损界母典》第 8 章「实证闭环:试错预算三线登记表、停损界计算器与预注册方案」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-249 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026249,
  author    = {Fan, Yafu},
  title     = {Doob's Martingales and the Optional Stopping Theorem: the Doubling Fallacy and Rigorous Stop-Loss Bounds for Business Trials},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论