What does Reactivation, Thresholds and Flash Clearance conclude, in numbers, about “Survival Curves of Purchase Gaps: Censoring, Kaplan–Meier and the Misreading of Dormancy”?
Answer: The ledger holds 2,899 gaps. Of these, 2,299 ended in an observed order and 600 are censored, exactly one per buyer. The survival curve says that 0.8178 of gaps last longer than 15 days, 0.5736 longer than 30 days, and only 0.2563 longer than 60 days. By 120 and 180 days the curve has almost stopped moving, resting near 0.1142 and 0.1072. That flat stretch matters a great deal, and the next section returns to it.
Scope of the numbers: Parameters are illustrative and correspond to no real customer, order or supplier of HOMIE-X, every price in the book is illustrative, and all calculations are generated by the book's programs. This is general business analysis, not personalised business, tax or legal advice.
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.1072, 0.1142, 0.2563, 0.5736, 0.8178, 120
| gaps 2,899 orders seen 2,299 censored 600 | |
| day KM S(t) share of buyers still waiting | |
| 15 | 0.8178 |
| 30 | 0.5736 |
| 45 | 0.3875 |
| 60 | 0.2563 |
| 90 | 0.1431 |
| 120 | 0.1142 |
| 180 | 0.1072 |
| median gap, Kaplan-Meier | 35.3 days |
| median gap, drop open gaps | 29.3 days |
| median gap, open gap = order | 31.8 days |
| Weibull median of live buyers | 31.3 days |
Show the full program
# Chapter 1. p11: Kaplan-Meier curve of inter-purchase gaps, censored.
# Model (illustrative, synthetic): 600 repeat buyers of a private-channel
# reseller. Each buyer's gaps between orders are Weibull with shape 1.5
# and scale 40 days; after every order the buyer stays active with
# probability 0.85. The ledger closes on day 365, so the last open gap of
# every buyer is right-censored. We compare three medians of the gap:
# Kaplan-Meier (censoring handled), "drop the open gaps" and "treat the
# open gap as if an order arrived on the closing day".
import math
import random
rng = random.Random(20261120)
N, HORIZON, SHAPE, SCALE, STAY = 600, 365.0, 1.5, 40.0, 0.85
def weibull_draw(r):
return SCALE * (-math.log(1.0 - r.random())) ** (1.0 / SHAPE)
def make_ledger():
gaps = [] # (length in days, 1 = order seen)
for _ in range(N):
t = rng.uniform(0.0, 300.0) # first order day
alive = True
while True:
if not alive:
gaps.append((HORIZON - t, 0))
break
g = weibull_draw(rng)
if t + g > HORIZON:
gaps.append((HORIZON - t, 0))
break
gaps.append((g, 1))
t += g
alive = rng.random() < STAY
return gaps
def kaplan_meier(gaps):
data = sorted(gaps)
at_risk = len(data)
s, curve, i = 1.0, [], 0
while i < len(data):
t = data[i][0]
d = c = 0
while i < len(data) and data[i][0] == t:
d += data[i][1]
c += 1 - data[i][1]
i += 1
if d:
s *= 1.0 - d / at_risk
curve.append((t, s))
at_risk -= d + c
return curve
def surv_at(curve, t):
s = 1.0
for ti, si in curve:
if ti > t:
break
s = si
return s
def km_median(curve):
for t, s in curve:
if s <= 0.5:
return t
return float("nan")
if __name__ == "__main__":
gaps = make_ledger()
n_ev = 0
for g in gaps:
n_ev += g[1]
print("gaps {:,} orders seen {:,} censored {:,}".format(
len(gaps), n_ev, len(gaps) - n_ev))
km = kaplan_meier(gaps)
print("day KM S(t) share of buyers still waiting")
for t in (15, 30, 45, 60, 90, 120, 180):
print("{:>4} {:.4f}".format(t, surv_at(km, t)))
seen = sorted(g for g, e in gaps if e)
naive = seen[len(seen) // 2]
as_ev = kaplan_meier([(g, 1) for g, e in gaps])
true_med = SCALE * math.log(2.0) ** (1.0 / SHAPE)
print("median gap, Kaplan-Meier {:6.1f} days".format(km_median(km)))
print("median gap, drop open gaps {:6.1f} days".format(naive))
print("median gap, open gap = order {:6.1f} days".format(
km_median(as_ev)))
print("Weibull median of live buyers {:6.1f} days".format(true_med))Single source and citation
Fan, Y. (2026). Repeat-Buyer Reactivation in Private-Channel Commerce, Threshold Bundle Margin Design and Flash-Clearance Dynamics (Version 1.0.0), Chapter 1: Survival Curves of Purchase Gaps: Censoring, Kaplan–Meier and the Misreading of Dormancy. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-353 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026353,
author = {Fan, Yafu},
title = {Repeat-Buyer Reactivation in Private-Channel Commerce, Threshold Bundle Margin Design and Flash-Clearance Dynamics},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 2 · Buy-Till-You-Die: the Probability of Being Alive and Next Quarter's Expected Orders
- Chapter 3 · The Incremental Ledger of a Reactivation Coupon: Survival, Leakage to Sure Returners and the Coupon Band
- Chapter 4 · Free-Shipping Thresholds: Piecewise Expected Margin and the Revenue Trap
- Chapter 5 · Margin Design of Spend-and-Save Ladders: Where the Savings Leak
- Chapter 6 · Clearing Tail Stock: Finite-Horizon Pricing, Two-Hour Pulses and Regulars Who Wait
- Chapter 7 · Ji Ran and Dupuit: the Reversal of Dear and Cheap and Tiered Tolls in the Classical Sources
- Chapter 8 · The Empirical Loop: the Regulars' Ledger and the Pricing and Closing Tool Specification