关于「实践与预注册试验」,《贝叶斯搜索与最优停止》给出的定量结论是什么?

结论:样本量按以下假设计算:最小关注效应为 4 个百分点(0.04);每名参与者比例的标准差取 0.12(20 局的二项抽样误差约为 0.107,加上个人之间的差异;模型中的标准差为 0.107 到 0.120),双侧 \(\alpha = 0.05\),把握度 90%。每组需要 190 名可分析的参与者;考虑约 15% 的人因未完成或注意力检查失败被排除,每组招募 224 名,共 448 名。标准差为 0.10 或 0.14 时,每组分别需要 132 与 258 名;最小关注效应为 0.03 时,标准差 0.12 下需要 337 名。这些参数都是假设值。正式试验之前先做一个小规模预试验,只用来检查任务程序、讲解时长与注意力检查是否正常,不用来改变样本量。

数据口径:本书是教学与研究用的数学模型,不是投资、创业、职业或人力资源建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(17 段程序,全部核对)、原典与作者的假说。

English version

对照数据表

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

model: control mean share 0.321 (SD 0.120), trained 0.367 (SD 0.107)
model difference +0.046; ceiling with the optimal cutoff0.376
analysable participants per arm, power 90 %:
SD of share diff 0.03 diff 0.04 diff 0.05
0.10234 132 85
0.12337 190 122
0.14458 258 165
pre-registered plan: SD 0.12, smallest effect of interest 0.04, 15 % excluded
power 90 %190 analysable and 224 recruited per arm, 448 in all
查看完整验算程序
# Chapter 8 trial. Part 1: a MODEL (simulated participants, not data). 20 games of the
# secretary problem, n = 40, ranks only; each person skips round(40 x) then takes the
# first relative best; control x ~ N(0.22, 0.10), trained x ~ N(0.33, 0.07), truncated
# to [0.02, 0.90]: assumptions, not estimates. Outcome: share of games best chosen.
# Part 2: sample size for a difference in mean shares, two-sided alpha 0.05.
import math, random
from statistics import NormalDist, mean, stdev

N, GAMES = 40, 20

def p_success(r):                        # skip r - 1 applicants, exact probability
    return 1 / N if r == 1 else (r - 1) / N * sum(1 / (i - 1) for i in range(r, N + 1))

def participant(mu, sd, rng):
    x = min(0.90, max(0.02, rng.gauss(mu, sd)))
    p = p_success(round(N * x) + 1)
    return sum(rng.random() < p for _ in range(GAMES)) / GAMES

def n_per_arm(sd, diff, power=0.90, alpha=0.05):
    z = NormalDist().inv_cdf
    return math.ceil(2 * (z(1 - alpha / 2) + z(power)) ** 2 * sd ** 2 / diff ** 2)

if __name__ == "__main__":
    rng = random.Random(1997)
    ctrl = [participant(0.22, 0.10, rng) for _ in range(20000)]
    trn = [participant(0.33, 0.07, rng) for _ in range(20000)]
    print(f"model: control mean share {mean(ctrl):.3f} (SD {stdev(ctrl):.3f}),"
          f" trained {mean(trn):.3f} (SD {stdev(trn):.3f})")
    print(f"model difference {mean(trn) - mean(ctrl):+.3f};"
          f" ceiling with the optimal cutoff: {p_success(16):.3f}")
    print("analysable participants per arm, power 90 %:")
    print("   SD of share   diff 0.03   diff 0.04   diff 0.05")
    for sd in (0.10, 0.12, 0.14):
        cols = "      ".join(f"{n_per_arm(sd, d):6d}" for d in (0.03, 0.04, 0.05))
        print(f"      {sd:.2f}       {cols}")
    print("pre-registered plan: SD 0.12, smallest effect of interest 0.04, 15 % excluded")
    n = n_per_arm(0.12, 0.04); rec = math.ceil(n / 0.85)
    print(f"   power 90 %: {n} analysable and {rec} recruited per arm, {2 * rec} in all")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《未知地形中的贝叶斯搜索、秘书问题与吉廷斯指数》第 8 章「实践与预注册试验」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23810102

DOI: 10.5281/zenodo.23810102 · 阅读本章所在专著 · 5DL-B-042 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026042,
  author    = {Fan, Yafu},
  title     = {Bayesian Search in Unknown Landscapes, Optimal Stopping and Gittins Indices},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.23810102},
  url       = {https://doi.org/10.5281/zenodo.23810102}
}

本书其他章节结论