关于「实证闭环:收货三区流程、送检秒收判定器与预注册检验」,《奢品多特征似然比初筛》给出的定量结论是什么?

结论:第八章给出收货三区流程、送检秒收判定器与预注册检验方案:检验类内相关需 194 件已鉴定的一致货,检验对数损失需 373 件,检验秒收区不符比例需随机抽检 386 件。书中以标注框区分已发表的证据、可运行的 Python 计算(18 段程序)、原典与作者的假说。

数据口径:书中全部概率只是外观概率参考,不是官方鉴定证书,不构成真伪结论,涉及争议或高价值货品须送品牌或专业鉴定机构;品牌一律以通称指代;书中参数为示意,全部计算由书中程序生成;本书是非个人化经营建议。 第二章是全书核心:示意参数下,朴素后验判到 0.99 以上、平均 0.996 的货,实际不符只有 0.756;放大倍数随类内相关升高,在相关系数 0.6 时达到 2.28;但排序并不吃亏,伤害集中在远离先验的边界上。

English version

对照数据表

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

(1) correlation test, lab-confirmed items needed:
r0.2: n = 194
r0.3: n = 85
r0.5: n = 30
(2) log-loss gain per item 0.0613, sd 0.4220: n373 items
(3) audit 386 instant buys; pass if at most 3 are N
size 0.0495, power 0.8700
at 10 audited buys a week39 weeks; at 40 referrals a week the
log-loss test needs 10 weeks
查看完整验算程序
# Chapter 8. p82: sample sizes for the pre-registered test. Three
# questions, two-sided alpha 0.05 and power 0.80 unless stated.
# (1) Is there within-class correlation between two feature scores?
#     Fisher z: n = ((z_a + z_b) / atanh(r))^2 + 3 lab-confirmed items.
# (2) Does the corrected posterior beat the naive one in log loss?
#     Paired per-item differences simulated under matrix R of p31.
# (3) Is the N share in the instant-buy zone below 0.02 when the true
#     share is 0.005? Exact one-sided binomial search, alpha 0.05.
import math
import random
from statistics import NormalDist

ZA, ZB = NormalDist().inv_cdf(0.975), NormalDist().inv_cdf(0.80)
D = [1.2, 1.0, 1.5, 0.9]
R = [[1.0, 0.3, 0.2, 0.5],
     [0.3, 1.0, 0.6, 0.2],
     [0.2, 0.6, 1.0, 0.2],
     [0.5, 0.2, 0.2, 1.0]]
PRIOR_N = 0.10


def cholesky(a):
    n = len(a)
    low = [[0.0] * n for _ in range(n)]
    for i in range(n):
        for j in range(i + 1):
            s = a[i][j] - math.fsum(low[i][k] * low[j][k] for k in range(j))
            low[i][j] = math.sqrt(s) if i == j else s / low[j][j]
    return low


def solve(a, b):
    n = len(b)
    m = [row[:] + [b[i]] for i, row in enumerate(a)]
    for c in range(n):
        p = max(range(c, n), key=lambda r: abs(m[r][c]))
        m[c], m[p] = m[p], m[c]
        for r in range(c + 1, n):
            f = m[r][c] / m[c][c]
            m[r] = [x - f * y for x, y in zip(m[r], m[c])]
    x = [0.0] * n
    for r in range(n - 1, -1, -1):
        x[r] = (m[r][n] - math.fsum(m[r][k] * x[k]
                                    for k in range(r + 1, n))) / m[r][r]
    return x


def dot(x, y):
    return math.fsum(a * b for a, b in zip(x, y))


def post(w):
    o = math.log(PRIOR_N / (1.0 - PRIOR_N)) + w
    return 1.0 / (1.0 + math.exp(-o)) if o > -700 else 0.0


def binom_cdf(k, n, p):
    terms = [math.comb(n, i) * p ** i * (1 - p) ** (n - i)
             for i in range(k + 1)]
    return math.fsum(terms)


print("(1) correlation test, lab-confirmed items needed:")
for r in [0.2, 0.3, 0.5]:
    n = ((ZA + ZB) / math.atanh(r)) ** 2 + 3
    print("    r = %.1f: n = %d" % (r, math.ceil(n)))
L = cholesky(R)
W = solve(R, D)
C2, T2 = dot(D, D) / 2.0, dot(D, W) / 2.0
rng = random.Random(20261113)
diffs = []
for _ in range(20000):
    y = 1 if rng.random() < PRIOR_N else 0
    e = [rng.gauss(0.0, 1.0) for _ in range(4)]
    z = [y * D[i] + dot(L[i], e) for i in range(4)]
    qn, qe = post(dot(D, z) - C2), post(dot(W, z) - T2)
    ln = -math.log(max(qn if y else 1.0 - qn, 1e-300))
    le = -math.log(max(qe if y else 1.0 - qe, 1e-300))
    diffs.append(ln - le)
mu = math.fsum(diffs) / len(diffs)
sd = math.sqrt(math.fsum((x - mu) ** 2 for x in diffs) / (len(diffs) - 1))
n2 = math.ceil(((ZA + ZB) * sd / mu) ** 2)
print("(2) log-loss gain per item %.4f, sd %.4f: n = %d items" % (mu, sd, n2))
p0, p1 = 0.02, 0.005
for n in range(50, 3000):
    k = 0
    while binom_cdf(k + 1, n, p0) <= 0.05:
        k += 1
    if binom_cdf(k, n, p0) > 0.05:
        continue
    if binom_cdf(k, n, p1) >= 0.80:
        print("(3) audit %d instant buys; pass if at most %d are N" % (n, k))
        print("    size %.4f, power %.4f"
              % (binom_cdf(k, n, p0), binom_cdf(k, n, p1)))
        break
weeks = math.ceil(n / 10.0)
print("at 10 audited buys a week: %d weeks; at 40 referrals a week the"
      % weeks)
print("    log-loss test needs %d weeks" % math.ceil(n2 / 40.0))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《奢品真伪多特征似然比鉴定、走线节距五金光谱皮质纹理融合与送检秒收贝叶斯边界母典》第 8 章「实证闭环:收货三区流程、送检秒收判定器与预注册检验」(版本 1.0.0). 5D Library. DOI 待发布

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

BibTeX
@book{fan2026281,
  author    = {Fan, Yafu},
  title     = {Multi-Feature Likelihood-Ratio Screening of Pre-Owned Luxury Goods: Fusing Stitch Pitch, Hardware Spectra and Leather Grain, and the Bayesian Boundary between Lab Referral and Instant Purchase},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论