What does Conformal Intervals for Orders conclude, in numbers, about “Marginal Is Not Conditional: Traffic Bands, Customer Segments and Intervals Too Wide to Use”?
Answer: Chapter 5 separates marginal from conditional coverage: high-traffic days can fall to 0.8798, and a score scaled by traffic brings all three bands back near 0.95.
Scope of the numbers: Parameters are illustrative; all calculations are generated by the book's programs; the book is general business analysis, not individualised business advice. Marked boxes separate published evidence, runnable Python calculations (23 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.8798
| alpha = 0.05, m = 200; coverage by traffic band | |||||
| score | all | V<800 | 800-1400 | V>=1400 | mean width |
| plain |r| | 0.9525 | 0.9998 | 0.9779 | 0.8798 | 21.68 |
| |r| / V | 0.9511 | 0.9483 | 0.9533 | 0.9516 | 17.75 |
Show the full program
# Chapter 5. p51: marginal coverage hides unequal days.
# Model (illustrative): daily visitors V uniform on 200 to 2,000;
# orders Y = 0.03 V + noise with sd 0.004 V (noise grows with
# traffic). A least-squares line is fitted on 200 days, 200 days
# calibrate, and 6,000 new days test; 40 repetitions. Score A is the
# plain residual |y - yhat|; score B divides it by V (a locally
# weighted score in the spirit of Lei et al. 2018). Coverage is
# reported by traffic band.
import math
import random
import statistics
def day(rng):
v = rng.uniform(200.0, 2000.0)
return v, 0.03 * v + rng.gauss(0.0, 0.004 * v)
def fit(rows):
vs = [r[0] for r in rows]
ys = [r[1] for r in rows]
mv, my = statistics.fmean(vs), statistics.fmean(ys)
sxy = math.fsum((v - mv) * (y - my) for v, y in rows)
sxx = math.fsum((v - mv) ** 2 for v in vs)
b = sxy / sxx
return my - b * mv, b
def band(v):
return 0 if v < 800 else (1 if v < 1400 else 2)
if __name__ == "__main__":
rng = random.Random(20261113)
hits = {s: [[0, 0], [0, 0], [0, 0]] for s in "AB"}
wid = {"A": [], "B": []}
for _ in range(40):
a, b = fit([day(rng) for _ in range(200)])
cal = [day(rng) for _ in range(200)]
k = math.ceil(201 * 0.95)
qa = sorted(abs(y - a - b * v) for v, y in cal)[k - 1]
qb = sorted(abs(y - a - b * v) / v for v, y in cal)[k - 1]
for _ in range(6000):
v, y = day(rng)
r = abs(y - a - b * v)
g = band(v)
for s, h in (("A", qa), ("B", qb * v)):
hits[s][g][0] += (r <= h)
hits[s][g][1] += 1
wid[s].append(2 * h)
print("alpha = 0.05, m = 200; coverage by traffic band")
print("score all V<800 800-1400 V>=1400 mean width")
for s, lab in (("A", "plain |r|"), ("B", "|r| / V")):
t = hits[s]
tot = (t[0][0] + t[1][0] + t[2][0]) / (t[0][1] + t[1][1] + t[2][1])
print("{:<12s} {:.4f} {:.4f} {:.4f} {:.4f} {:.2f}".format(
lab, tot, t[0][0] / t[0][1], t[1][0] / t[1][1],
t[2][0] / t[2][1], statistics.fmean(wid[s])))Single source and citation
Fan, Y. (2026). Conformal Prediction and Distribution-Free Intervals: Finite-Sample Coverage Guarantees for Order Counts and Order Values (Version 1.0.0), Chapter 5: Marginal Is Not Conditional: Traffic Bands, Customer Segments and Intervals Too Wide to Use. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-306 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026306,
author = {Fan, Yafu},
title = {Conformal Prediction and Distribution-Free Intervals: Finite-Sample Coverage Guarantees for Order Counts and Order Values},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Coverage Gap of Normal Intervals: Heavy-Tailed Orders Push Every Miss to the Right
- Chapter 2 · The Correct Rank: Why "Plus One" Matters and Where the Finite-Sample Guarantee Comes From
- Chapter 3 · The Price of the Guarantee: Interval Width, the Shape of the Score and the Extra Paid When Normality Holds
- Chapter 4 · How Large a Calibration Set: Coverage Given the Calibration Set Follows a Beta Law
- Chapter 6 · When Exchangeability Breaks: Weekend Effects, Growth Drift, Promotion Shocks and Three Repairs
- Chapter 7 · Classical Sources East and West: Guo Shoujing's "The Calendar Rests on Measurement" and Neyman's Confidence Intervals
- Chapter 8 · Closing the Loop: the Weekly Order-Count Interval Sheet, the Conformal Interval Calculator and a Pre-Registered Test