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
scoreallV<800800-1400V>=1400mean width
plain |r|0.95250.99980.97790.879821.68
|r| / V0.95110.94830.95330.951617.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