关于「串联高估:特征共因时朴素贝叶斯把同一份证据数了几遍」,《二手精品鉴定与柠檬折价》给出的定量结论是什么?
结论:第二章说明特征有共同原因时朴素连乘会重复计数证据:在边际参数完全正确的模型里,一组观察的朴素后验是 0.88503,精确后验只有 0.34611;用已确认记录拟合的回火权重为 0.75。
数据口径:书中参数为示意;全部计算由书中程序生成;本书不是对任何具体交易的定价意见,也不构成个人化的法律或理财建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(20 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.34611, 0.88503
| careful-tier rates 0.575 0.400 0.300 0.670 | |||||
| untouched-auth rates 0.0250 0.0375 0.0750 0.0225 | |||||
| phi(F2,F3): within counterfeits 0.267, within authentic 0.175 | |||||
| pattern | naive P | exact P | naive dB | exact dB | overcount |
| 0000 | 0.00057 | 0.00355 | -22.9 | -14.9 | -8.0 |
| 0110 | 0.09197 | 0.02915 | -0.4 | -5.7 | 5.3 |
| 1100 | 0.47523 | 0.30685 | 9.1 | 6.0 | 3.1 |
| 1110 | 0.88503 | 0.34611 | 18.4 | 6.8 | 11.6 |
| 1111 | 0.99929 | 0.99389 | 41.0 | 31.7 | 9.4 |
| 0111 | 0.94887 | 0.69907 | 22.2 | 13.2 | 9.0 |
查看完整验算程序
# Chapter 2. p21: when features share a hidden cause, naive Bayes counts
# the same evidence twice. Counterfeits come from a crude workshop
# tier (weight 0.6) or a careful tier (0.4); authentic bags are either
# untouched (0.8) or refurbished (0.2), and refurbishing makes honest
# bags show anomalies. Within a tier features are independent, so the
# exact posterior is a two-component mixture. The tier rates are
# illustrative and chosen so that the marginal sensitivity and
# specificity equal those of p11 exactly.
import math
SENS = [0.80, 0.70, 0.60, 0.85]
FP = [0.05, 0.10, 0.15, 0.03] # 1 - specificity
CRUDE = [0.95, 0.90, 0.80, 0.97]
CAREFUL = [(s - 0.6 * c) / 0.4 for s, c in zip(SENS, CRUDE)]
REFURB = [0.15, 0.35, 0.45, 0.06]
PLAIN = [(m - 0.2 * r) / 0.8 for m, r in zip(FP, REFURB)]
FAKE = [(0.6, CRUDE), (0.4, CAREFUL)]
AUTH = [(0.2, REFURB), (0.8, PLAIN)]
PRIOR = 0.10
def lik(mix, pat):
return math.fsum(w * math.prod(r if b else 1 - r
for b, r in zip(pat, rates))
for w, rates in mix)
def corr(mix, i, j):
pi = lik_marg(mix, i)
pj = lik_marg(mix, j)
pij = math.fsum(w * rates[i] * rates[j] for w, rates in mix)
return (pij - pi * pj) / math.sqrt(pi * (1 - pi) * pj * (1 - pj))
def lik_marg(mix, i):
return math.fsum(w * rates[i] for w, rates in mix)
print("careful-tier rates", " ".join("{:.3f}".format(x) for x in CAREFUL))
print("untouched-auth rates", " ".join("{:.4f}".format(x) for x in PLAIN))
print("phi(F2,F3): within counterfeits {:.3f}, within authentic {:.3f}"
.format(corr(FAKE, 1, 2), corr(AUTH, 1, 2)))
print("pattern naive P exact P naive dB exact dB overcount")
po = PRIOR / (1 - PRIOR)
for s in ("0000", "0110", "1100", "1110", "1111", "0111"):
pat = [int(c) for c in s]
naive = math.prod((se / fp) if b else (1 - se) / (1 - fp)
for b, se, fp in zip(pat, SENS, FP))
exact = lik(FAKE, pat) / lik(AUTH, pat)
pn, pe = po * naive / (1 + po * naive), po * exact / (1 + po * exact)
dn, de = 10 * math.log10(naive), 10 * math.log10(exact)
print("{} {:.5f} {:.5f} {:6.1f} {:6.1f} {:5.1f}"
.format(s, pn, pe, dn, de, dn - de))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《二手精品多特征贝叶斯鉴定、阿克洛夫柠檬折价均衡与限量包款二级市场折旧半衰期》第 2 章「串联高估:特征共因时朴素贝叶斯把同一份证据数了几遍」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-171 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026171,
author = {Fan, Yafu},
title = {Multi-Feature Bayesian Authentication of Pre-Owned Luxury, Akerlof Lemon-Discount Equilibria and the Resale Half-Life of Limited Bags},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}