What does Likelihood-Ratio Screening of Luxury Goods conclude, in numbers, about “Closing the Loop: a Three-Zone Intake Procedure, the Refer-or-Buy Screener and a Pre-Registered Test”?
Answer: Chapter 8 gives a three-zone intake procedure, the Refer-or-Buy Intake Screener and a pre-registered test plan: testing within-class correlation needs 194 authenticated conforming items, testing log loss 373, and testing the instant-buy zone 386 random audits. Marked boxes separate published evidence, runnable Python calculations (18 programs), classical sources and the author's hypotheses.
Scope of the numbers: Brands are named only generically, the parameters are illustrative, all calculations are generated by the book's programs, and the book is not individual business advice. Chapter 3 gives the effective number of independent features (four features are worth only 2.007 under the illustrative matrix) and a one-number slope of 0.571.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 194, 373, 386
| (1) correlation test, lab-confirmed items needed: | |
| r | 0.2: n = 194 |
| r | 0.3: n = 85 |
| r | 0.5: n = 30 |
| (2) log-loss gain per item 0.0613, sd 0.4220: n | 373 items |
| (3) audit 386 instant buys; pass if at most 3 are N | |
| size 0.0495, power 0.8700 | |
| at 10 audited buys a week | 39 weeks; at 40 referrals a week the |
| log-loss test needs 10 weeks |
Show the full program
# 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))Single source and citation
Fan, Y. (2026). 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 (Version 1.0.0), Chapter 8: Closing the Loop: a Three-Zone Intake Procedure, the Refer-or-Buy Screener and a Pre-Registered Test. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 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}
}Other chapter answers in this book
- Chapter 1 · Weight of Evidence: Single-Feature Likelihood Ratios, Decibans and the Sum of Four Features
- Chapter 2 · Double Counting: How Correlated Features Make Naive Bayes Overconfident
- Chapter 3 · Correcting for Correlation: the Effective Number of Independent Features, Exact Weights and a One-Number Slope
- Chapter 4 · A Loss Matrix and Three Zones: Instant Buy, Referral and Decline
- Chapter 5 · Measuring More or Stopping: Cheap Evidence Is Worth Most at the Boundaries
- Chapter 6 · Channel Priors, Audits and Calibration: What Gets Referred Decides What a Store Can Learn
- Chapter 7 · East and West in the Sources: Suspecting the Neighbour of the Axe, and Peirce's Thermometer of Belief