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
daypooledwkday/wkendratio score
Mon0.99550.96160.9526
Tue0.99550.96160.9536
Wed0.99550.96160.9526
Thu0.99550.96160.9520
Fri0.98610.90650.9515
Sat0.82520.95290.9541
Sun0.88180.96500.9541
week0.95360.95300.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