关于「购买间隔生存曲线:删失、Kaplan-Meier 与沉睡误读」,《熟客唤醒与凑单闪购》给出的定量结论是什么?

结论:台账里共有 2,899 段间隔,2,299 段看到了终点,600 段被删失,恰好每人一段。生存曲线告诉我们:间隔超过 15 天的占 0.8178,超过 30 天的占 0.5736,超过 60 天的只剩 0.2563。到了 120 天与 180 天,曲线几乎不动,停在 0.1142 和 0.1072 附近。这一截平台很重要,下一节再细说。

数据口径:示意参数下,面额 RM 6 的券只在间隔比 0.85 到 11.37 之间净值为正,刚买客与久睡客都是负值;不设对照组的核销记账会把增量高估 12.2 倍。 书中参数为示意,不对应 HOMIE-X 任何真实客户、订单或供货商,书中价格一律为示意;全部计算由书中程序生成。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 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
150.8178
300.5736
450.3875
600.2563
900.1431
1200.1142
1800.1072
median gap, Kaplan-Meier35.3 days
median gap, drop open gaps29.3 days
median gap, open gap = order31.8 days
Weibull median of live buyers31.3 days
查看完整验算程序
# 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))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《私域代购熟客复购唤醒、满额凑单毛利配比与限时清仓脉冲闪购母典》第 1 章「购买间隔生存曲线:删失、Kaplan-Meier 与沉睡误读」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 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}
}

本书其他章节结论