What does Sizing Systems and Return Minimisation conclude, in numbers, about “Closing the Loop: a Buyer's Direct-Message Size Recommender, a Return-Reason Code Table and a Pre-Registered Test”?
Answer: Chapter 8 gives a buyer's direct-message size recommender (fit probability 0.9441 in the worked example), a return-reason code table and a pre-registered test plan. Marked boxes separate published evidence, runnable Python calculations (21 programs), classical sources and the author's hypotheses.
Scope of the numbers: Its brands, shops, prices and body dimensions are illustrative; all calculations are generated by its programs; the book is not individual business advice, deals only with the measurement of garment sizes, and makes no health judgement. Marked boxes separate published evidence, runnable Python calculations (21 programs), classical sources and the author's hypotheses.
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: 0.9441
brand n shrunk offset sd Alder 3 +2.434 0.693 Birch 2 -1.868 0.825 Cedar 5 +0.407 0.550 Dune 1 +2.838 1.078 Elm 3 -0.117 0.693 kept: Alder M, Cedar L, Elm L -> ideal 109.49 cm (sd 1.20) target Birch, offset -1.868, total sd 1.659 M mean error -5.35 small 0.7927 fit 0.2073 large 0.0000 L mean error -1.35 small 0.0553 fit 0.9441 large 0.0006 XL mean error +2.65 small 0.0000 fit 0.7926 large 0.2073 XXL mean error +6.65 small 0.0000 fit 0.0553 large 0.9447 recommend L (P(fit) 0.9441)
Show the full program
# Chapter 8. p81: The buyer's direct-message size recommender, worked.
# Store data: flat-measured deviations (cm) of label M from the house
# standard 106 cm for each brand; offsets are shrunk with tau = 2.0 and
# a per-garment sd of 1.28 (p41). Customer data: the items she kept.
# Each kept item says her ideal chest is near nominal(label) + offset,
# with sd sqrt(2.0^2 + v_off); a N(106, 7.16^2) prior completes the
# precision-weighted estimate. For the target brand every label gets
# P(too small), P(fit), P(too large) with T = 4 cm and style sd 0.8.
# Brand names and numbers are invented for the demonstration.
import math
from statistics import NormalDist
Z = NormalDist()
TAU, SDG, KEPT, STYLE, T = 2.0, 1.28, 2.0, 0.8, 4.0
PRIOR_MU, PRIOR_SD = 106.0, 7.16
LABELS = ("XS", "S", "M", "L", "XL", "XXL")
MEAS = {"Alder": [2.1, 3.4, 2.8], "Birch": [-1.9, -2.6],
"Cedar": [0.4, 1.1, -0.2, 0.6, 0.3], "Dune": [4.0],
"Elm": [-0.8, 0.5, -0.1]}
def nominal(label):
return 106.0 + 4.0 * (LABELS.index(label) - 2)
def offset(brand):
xs = MEAS.get(brand, [])
n = len(xs)
if n == 0:
return 0.0, TAU ** 2
k = TAU ** 2 / (TAU ** 2 + SDG ** 2 / n)
return k * math.fsum(xs) / n, k * SDG ** 2 / n
def ideal(kept):
w = [1.0 / PRIOR_SD ** 2]
y = [PRIOR_MU / PRIOR_SD ** 2]
for brand, label in kept:
u, v = offset(brand)
prec = 1.0 / (KEPT ** 2 + v)
w.append(prec)
y.append(prec * (nominal(label) + u))
return math.fsum(y) / math.fsum(w), 1.0 / math.fsum(w)
def table(target, kept):
mu, var = ideal(kept)
u, v = offset(target)
sd = math.sqrt(var + v + STYLE ** 2)
rows = []
for lab in LABELS:
m = nominal(lab) + u - mu
ps, pl = Z.cdf((-T - m) / sd), 1.0 - Z.cdf((T - m) / sd)
rows.append((lab, m, ps, 1.0 - ps - pl, pl))
return mu, math.sqrt(var), u, sd, rows
print("brand n shrunk offset sd")
for b in sorted(MEAS):
u, v = offset(b)
print("%-6s %d %+.3f %.3f" % (b, len(MEAS[b]), u, math.sqrt(v)))
kept = [("Alder", "M"), ("Cedar", "L"), ("Elm", "L")]
mu, s, u, sd, rows = table("Birch", kept)
print("kept: Alder M, Cedar L, Elm L -> ideal %.2f cm (sd %.2f)" % (mu, s))
print("target Birch, offset %+.3f, total sd %.3f" % (u, sd))
for lab, m, ps, pf, pl in rows:
if pf > 0.01:
print(" %-3s mean error %+.2f small %.4f fit %.4f large %.4f"
% (lab, m, ps, pf, pl))
best = max(rows, key=lambda r: r[3])
print("recommend %s (P(fit) %.4f)" % (best[0], best[3]))Single source and citation
Fan, Y. (2026). Anthropometric Principal-Component Sizing, Vanity-Size Drift and Cross-Border Return-Rate Minimisation (Version 1.0.0), Chapter 8: Closing the Loop: a Buyer's Direct-Message Size Recommender, a Return-Reason Code Table and a Pre-Registered Test. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-215 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026215,
author = {Fan, Yafu},
title = {Anthropometric Principal-Component Sizing, Vanity-Size Drift and Cross-Border Return-Rate Minimisation},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · A Label Is Not a Measurement: Brand Dispersion of the Same "M" as a Random Effect
- Chapter 2 · A Finer Size Chart or a Brand Residual: the Error Budget of Five Sizing Policies
- Chapter 3 · A Two-Dimensional Principal-Component Grid of Height and Girth: What a One-Axis Label Throws Away
- Chapter 4 · Shrinkage Estimates of Brand Offsets: How Far to Trust Two Measured Garments
- Chapter 5 · Vanity-Size Drift: Tracking a Moving Brand Offset with a Kalman Filter
- Chapter 6 · The Expected Cost of Returns: Sizing Up, Cross-Border Freight and Ordering Several Sizes
- Chapter 7 · Sources East and West: the Palace Tailors of the Zhou li and Quetelet's Average Man