关于「探索与利用:汤普森抽样与几种固定习惯的遗憾账」,《先手探针与隐藏事实》给出的定量结论是什么?
结论:汤普森抽样每翻一倍视野,新增遗憾大致持平:233.8、296.7、280.4、260.4。这正是对数增长的样子,与赖与罗宾斯的下界同阶。先试 200 位的做法,新增遗憾越来越大:173.2、320.8、564.7、1,120.2,因为卡住的那些运行一直在按时间亏钱。先试 800 位的做法,前期亏得重,访客数到 1,000 时累计 1,594.4;之后新增很少,但在 8,000 时累计 1,919.7,仍高于汤普森抽样的 1,604.7。
数据口径:书中参数为示意,全部计算由书中程序生成,数据全部是合成数据。 本书是非个人化经营建议,不构成法律、税务或投资意见,不向任何人承诺收入。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 1000, 1120.2, 1594.4, 1604.7, 173.2, 1919.7
| mean regret at each horizon (and added since the last one) | |||||
| policy | 500 | 1,000 | 2,000 | 4,000 | 8,000 |
| etc200 | 542.4 | 715.6 | 1,036.4 | 1,601.1 | 2,721.3 |
| added | 542.4 | 173.2 | 320.8 | 564.7 | 1,120.2 |
| etc800 | 975.0 | 1,594.4 | 1,668.4 | 1,759.7 | 1,919.7 |
| added | 975.0 | 619.4 | 74.0 | 91.4 | 160.0 |
| thompson | 533.4 | 767.2 | 1,063.9 | 1,344.3 | 1,604.7 |
| added | 533.4 | 233.8 | 296.7 | 280.4 | 260.4 |
查看完整验算程序
# Chapter 4. p42: how regret grows when the horizon doubles.
# Same four illustrative tiers as p41. A policy that keeps learning adds
# roughly the same regret per doubling of the horizon (logarithmic
# growth, the Lai-Robbins order); a policy that stops learning after a
# fixed explore phase adds regret in proportion to time whenever its
# early pick was wrong. 60 runs to 8,000 visitors.
import math
import random
PRICES = [20, 30, 40, 50]
CONV = [0.30, 0.24, 0.12, 0.06]
BEST = max(p * c for p, c in zip(PRICES, CONV))
MARKS = (500, 1000, 2000, 4000, 8000)
def play(rng, policy, horizon):
buys, shows = [0] * 4, [0] * 4
lost, out = [], {}
explore = {"etc200": 200, "etc800": 800}.get(policy, 0)
for t in range(horizon):
if t < explore:
a = t % 4
elif explore:
est = [PRICES[i] * (buys[i] + 1) / (shows[i] + 2)
for i in range(4)]
a = est.index(max(est))
else:
draw = [PRICES[i] * rng.betavariate(1 + buys[i],
1 + shows[i] - buys[i])
for i in range(4)]
a = draw.index(max(draw))
shows[a] += 1
if rng.random() < CONV[a]:
buys[a] += 1
lost.append(BEST - PRICES[a] * CONV[a])
if t + 1 in MARKS:
out[t + 1] = math.fsum(lost)
return out
if __name__ == "__main__":
rng = random.Random(39542)
reps = 60
print("mean regret at each horizon (and added since the last one)")
print(" policy " + "".join("{:>13,}".format(m) for m in MARKS))
for pol in ("etc200", "etc800", "thompson"):
acc = {m: [] for m in MARKS}
for _ in range(reps):
out = play(rng, pol, MARKS[-1])
for m in MARKS:
acc[m].append(out[m])
means = [math.fsum(acc[m]) / reps for m in MARKS]
print(" {:<8}".format(pol)
+ "".join("{:>13,.1f}".format(v) for v in means))
adds = [means[0]] + [b - a for a, b in zip(means, means[1:])]
print(" {:<8}".format(" added")
+ "".join("{:>13,.1f}".format(v) for v in adds))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《高能动性主动推理、意念强度先手扰动与商业隐藏事实勘探母典》第 4 章「探索与利用:汤普森抽样与几种固定习惯的遗憾账」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-395 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026395,
author = {Fan, Yafu},
title = {High-Agency Active Inference, Intentional Perturbation Probes and Hidden Market-Truth Exploration},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}