关于「实证闭环:周度阶段复盘、客户阶段解码器与预注册检验」,《隐马尔可夫与客户决策阶段》给出的定量结论是什么?

结论:第八章给出周度复盘流程、客户阶段解码器与预注册检验:检验一需要 372 次有自报阶段的访问,检验二每组 5301 次对话。书中以标注框区分已发表的证据、可运行的 Python 计算(18 段程序)、原典与作者的假说。

数据口径:书中阶段、页面类型与全部概率均为示意;全部计算由书中程序生成;本书是非个人化经营建议,只使用站内匿名化与客户同意的数据,不跨站追踪,不推断敏感属性,阶段解码不用于施压、差别定价或主动联系客户,紧迫感只来自真实库存与真实截止。 第一章在示意参数下量出:前向滤波的四分类准确率比最后一次点击高 0.0410,就绪判别从 0.6990 提高到 0.7630;增益随阶段黏性与页面区分力在 0.0307 到 0.1187 之间变化,维特比最后一格在页面模糊时反而低 0.1007。

English version

对照数据表

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

test 1: forward filter vs last click, ready-or-not
discordant: filter-only right 0.1295, last-only right 0.0655
difference 0.0640; McNemar needs 372 surveyed visits
at survey response 0.103720 consented visits invited
at survey response 0.201860 consented visits invited
test 2: opt-out or complaint share 0.040 vs 0.030
chats per arm5301, total 10602
at 300 non-price chats a week35.3 weeks
at 1000 non-price chats a week10.6 weeks
查看完整验算程序
# Chapter 8. p82: sample sizes for the pre-registered tests.
# Test 1 (paired, McNemar): on consented visits whose stage is later
# self-reported in a one-question survey, does the forward filter call
# ready-or-not right more often than the last-click rule? The discordant
# shares are taken from a fixed-seed simulation of the p11 HMM (4,000
# visits, as in p11). Test 2 (two proportions): does the quote rule of
# p61 lower the share of chats that end in an opt-out or complaint,
# from an assumed 0.040 under "always quote" to 0.030? alpha 0.05 two-
# sided, power 0.80. All inputs illustrative.
import math
import random
from statistics import NormalDist

PI = [0.70, 0.20, 0.08, 0.02]
A = [[0.70, 0.22, 0.06, 0.02],
     [0.08, 0.64, 0.23, 0.05],
     [0.02, 0.10, 0.66, 0.22],
     [0.01, 0.03, 0.16, 0.80]]
B = [[0.45, 0.30, 0.08, 0.07, 0.06, 0.04],
     [0.15, 0.35, 0.25, 0.12, 0.08, 0.05],
     [0.08, 0.22, 0.15, 0.30, 0.17, 0.08],
     [0.05, 0.12, 0.08, 0.15, 0.30, 0.30]]
K = 4
Z = NormalDist()
ZA, ZB = Z.inv_cdf(0.975), Z.inv_cdf(0.80)


def draw(rng, probs):
    u, acc = rng.random(), 0.0
    for k, p in enumerate(probs):
        acc += p  # step
        if u < acc:
            return k
    return len(probs) - 1


rng = random.Random(20261113)
n = 4000
f_only = l_only = 0
for _ in range(n):
    t_len = rng.randint(6, 14)
    s = [draw(rng, PI)]
    for _ in range(t_len - 1):
        s.append(draw(rng, A[s[-1]]))
    o = [draw(rng, B[k]) for k in s]
    f = [PI[k] * B[k][o[0]] for k in range(K)]
    m = PI[:]
    for x in o[1:]:
        z = math.fsum(f)
        f = [math.fsum(f[i] / z * A[i][j] for i in range(K)) * B[j][x]
             for j in range(K)]
        m = [math.fsum(m[i] * A[i][j] for i in range(K)) for j in range(K)]
    fr = max(range(K), key=lambda k: f[k]) >= 2
    lr = max(range(K), key=lambda k: m[k] * B[k][o[-1]]) >= 2
    truth = s[-1] >= 2
    f_only += 1 if (fr == truth and lr != truth) else 0  # step
    l_only += 1 if (lr == truth and fr != truth) else 0  # step
p10, p01 = f_only / n, l_only / n
pd, d = p10 + p01, p10 - p01
n_mc = (ZA * math.sqrt(pd) + ZB * math.sqrt(pd - d * d)) ** 2 / (d * d)
print("test 1: forward filter vs last click, ready-or-not")
print("  discordant: filter-only right %.4f, last-only right %.4f"
      % (p10, p01))
print("  difference %.4f; McNemar needs %d surveyed visits"
      % (d, math.ceil(n_mc)))
for resp in (0.10, 0.20):
    print("  at survey response %.2f: %d consented visits invited"
          % (resp, math.ceil(math.ceil(n_mc) / resp)))
p1, p2 = 0.040, 0.030
pbar = (p1 + p2) / 2
n2 = (ZA * math.sqrt(2 * pbar * (1 - pbar))
      + ZB * math.sqrt(p1 * (1 - p1) + p2 * (1 - p2))) ** 2 / (p1 - p2) ** 2
print("test 2: opt-out or complaint share %.3f vs %.3f" % (p1, p2))
print("  chats per arm: %d, total %d" % (math.ceil(n2), 2 * math.ceil(n2)))
for per_week in (300, 1000):
    print("  at %d non-price chats a week: %.1f weeks"
          % (per_week, 2 * math.ceil(n2) / per_week))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《隐马尔可夫维特比解码、浏览点击序列反推客户隐藏决策阶段与出手时机母典》第 8 章「实证闭环:周度阶段复盘、客户阶段解码器与预注册检验」(版本 1.0.0). 5D Library. DOI 待发布

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

BibTeX
@book{fan2026300,
  author    = {Fan, Yafu},
  title     = {Hidden Markov Models and Viterbi Decoding: Inferring a Customer's Hidden Decision Stage from Click Sequences and Timing the Offer},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论