关于「探索与利用:汤普森抽样与几种固定习惯的遗憾账」,《先手探针与隐藏事实》给出的定量结论是什么?

结论:汤普森抽样每翻一倍视野,新增遗憾大致持平: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。

数据口径:书中参数为示意,全部计算由书中程序生成,数据全部是合成数据。 本书是非个人化经营建议,不构成法律、税务或投资意见,不向任何人承诺收入。

English version

对照数据表

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

mean regret at each horizon (and added since the last one)
policy5001,0002,0004,0008,000
etc200542.4715.61,036.41,601.12,721.3
added542.4173.2320.8564.71,120.2
etc800975.01,594.41,668.41,759.71,919.7
added975.0619.474.091.4160.0
thompson533.4767.21,063.91,344.31,604.7
added533.4233.8296.7280.4260.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}
}

本书其他章节结论