What does Conformal Intervals for Orders conclude, in numbers, about “When Exchangeability Breaks: Weekend Effects, Growth Drift, Promotion Shocks and Three Repairs”?
Answer: Chapter 6 shows how weekend effects, growth drift and promotion shocks break exchangeability: pooled calibration covers Saturdays only 0.8252 of the time, a frozen calibration set misses 0.3602 of the time under growth, and weekday scaling and recent windows repair it.
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.8252
| alpha = 0.05, coverage of the next day, by weekday | |||
| day | pooled | wkday/wkend | ratio score |
| Mon | 0.9955 | 0.9616 | 0.9526 |
| Tue | 0.9955 | 0.9616 | 0.9536 |
| Wed | 0.9955 | 0.9616 | 0.9526 |
| Thu | 0.9955 | 0.9616 | 0.9520 |
| Fri | 0.9861 | 0.9065 | 0.9515 |
| Sat | 0.8252 | 0.9529 | 0.9541 |
| Sun | 0.8818 | 0.9650 | 0.9541 |
| week | 0.9536 | 0.9530 | 0.9529 |
Show the full program
# Chapter 6. p61: the weekend breaks exchangeability for "tomorrow".
# Model (illustrative): daily orders = 100 * f(day) * exp(e), e normal
# with sd 0.25; f = 1.0 Mon-Thu, 1.15 Fri, 1.6 Sat, 1.5 Sun. Four
# weeks fit, twelve weeks (84 days) calibrate. Pooled conformal uses
# one median centre. The weekday/weekend Mondrian version calibrates
# two groups apart (24 weekend days). The ratio score divides each
# day by its weekday median from the fit window. Coverage for each
# weekday is exact from the log-normal CDF; 2,000 repetitions.
import math
import random
import statistics
ND = statistics.NormalDist()
F = (1.0, 1.0, 1.0, 1.0, 1.15, 1.6, 1.5)
NAMES = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
S = 0.25
def cdf(d, x):
return 0.0 if x <= 0 else ND.cdf(math.log(x / (100 * F[d])) / S)
def q(sc, alpha=0.05):
k = math.ceil((len(sc) + 1) * (1 - alpha))
return math.inf if k > len(sc) else sorted(sc)[k - 1]
def rep(rng):
days = [(t % 7, 100 * F[t % 7] * math.exp(rng.gauss(0.0, S)))
for t in range(16 * 7)]
fit, cal = days[:28], days[28:]
c = statistics.median([y for _, y in fit])
qa = q([abs(y - c) for _, y in cal])
wk = [d >= 5 for d in range(7)]
cg = {g: statistics.median([y for d, y in fit if wk[d] == g])
for g in (False, True)}
qg = {g: q([abs(y - cg[g]) for d, y in cal if wk[d] == g])
for g in (False, True)}
med = [statistics.median([y for d, y in fit if d == e])
for e in range(7)]
qr = q([abs(y / med[d] - 1.0) for d, y in cal])
out = []
for d in range(7):
g = wk[d]
out.append((cdf(d, c + qa) - cdf(d, c - qa),
cdf(d, cg[g] + qg[g]) - cdf(d, cg[g] - qg[g]),
cdf(d, med[d] * (1 + qr)) - cdf(d, med[d] * (1 - qr))))
return out
if __name__ == "__main__":
rng = random.Random(20261113)
rows = [rep(rng) for _ in range(2000)]
print("alpha = 0.05, coverage of the next day, by weekday")
print("day pooled wkday/wkend ratio score")
avg = [[], [], []]
for d in range(7):
c = [math.fsum(r[d][j] for r in rows) / 2000 for j in range(3)]
for j in range(3):
avg[j].append(c[j])
print("{} {:.4f} {:.4f} {:.4f}".format(
NAMES[d], c[0], c[1], c[2]))
print("week {:.4f} {:.4f} {:.4f}".format(
*[math.fsum(a) / 7 for a in avg]))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 6: When Exchangeability Breaks: Weekend Effects, Growth Drift, Promotion Shocks and Three Repairs. 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 5 · Marginal Is Not Conditional: Traffic Bands, Customer Segments and Intervals Too Wide to Use
- 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