关于「在投时长:广告库里的生存曲线」,《广告库反查与进箱物理》给出的定量结论是什么?

结论:第一、二章用生存分析与比例风险模型给品牌打分,并说明撒网到整份名录时投诉率升到 0.298 %。

数据口径:公开广告库里仍在投的广告是右删失数据,须用卡普兰与迈耶的乘积极限估计去读;「仍在投且已投满 30 天」这条规则在合成广告库里把持续投放者的比例从 0.313 抬到 0.902。 书中参数为示意,全部计算由书中程序生成。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库

A. 600 ads, 129 still running on snapshot day (0.215)
day KM S(t) naive S(t) true S(t)
70.511 0.478 0.510
140.403 0.352 0.405
300.269 0.198 0.267
600.165 0.082 0.167
900.104 0.025 0.098
median days: KM 7.5 naive 6.3 true 7.5
B. by advertiser type (KM)
steady n188 running= 96 S(14)=0.796 S(30)=0.664
trial n412 running= 33 S(14)=0.223 S(30)=0.089
C. running and >30 days old: 61 ads, 55 steady (0.902)
base rate of steady among all ads0.313
log check: ln S_KM(30)-1.3123
查看完整验算程序
# Chapter 1. p11: Kaplan-Meier survival of ads seen in a public ad library.
# Model (synthetic, illustrative): 600 ads start uniformly over the last
# 120 days. 30 % come from "steady" advertisers whose ads run a Weibull
# time (shape 0.9, scale 80 days); 70 % from "trial" advertisers (shape
# 0.6, scale 7 days). An ad still running on the snapshot day is
# right-censored at its age. We compare the Kaplan-Meier estimate with
# the naive reading that treats every ad as if it had already stopped.
import math
import random

RNG = random.Random(20261120)
N, WINDOW = 600, 120.0
STEADY_SHARE = 0.30


def draw_ads(rng):
    ads = []
    for _ in range(N):
        steady = rng.random() < STEADY_SHARE
        shape, scale = (0.9, 80.0) if steady else (0.6, 7.0)
        dur = rng.weibullvariate(scale, shape)
        start = rng.uniform(0.0, WINDOW)
        age = WINDOW - start
        if dur > age:
            ads.append((age, 0, steady, dur))      # censored
        else:
            ads.append((dur, 1, steady, dur))      # stopped
    return ads


def kaplan_meier(rows):
    rows = sorted(rows, key=lambda r: (r[0], -r[1]))
    at_risk, s, curve = len(rows), 1.0, []
    i = 0
    while i < len(rows):
        t = rows[i][0]
        d = c = 0
        while i < len(rows) and rows[i][0] == t:
            if rows[i][1]:
                d += 1
            else:
                c += 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:
            s = si
        else:
            break
    return s


def km_median(curve):
    for t, s in curve:
        if s <= 0.5:
            return t
    return float("nan")


if __name__ == "__main__":
    ads = draw_ads(RNG)
    cens = len([a for a in ads if a[1] == 0])
    print("A. {} ads, {} still running on snapshot day ({:.3f})".format(
        N, cens, cens / N))
    km = kaplan_meier([(a[0], a[1]) for a in ads])
    naive = kaplan_meier([(a[0], 1) for a in ads])
    true = kaplan_meier([(a[3], 1) for a in ads])
    print("   day   KM S(t)   naive S(t)   true S(t)")
    for t in (7, 14, 30, 60, 90):
        print("   {:>3}   {:>7.3f}   {:>10.3f}   {:>9.3f}".format(
            t, surv_at(km, t), surv_at(naive, t), surv_at(true, t)))
    print("   median days: KM {:.1f}  naive {:.1f}  true {:.1f}".format(
        km_median(km), km_median(naive), km_median(true)))
    print("B. by advertiser type (KM)")
    for flag, name in ((True, "steady"), (False, "trial")):
        sub = [(a[0], a[1]) for a in ads if a[2] == flag]
        c = kaplan_meier(sub)
        run = len([1 for a in ads if a[2] == flag and a[1] == 0])
        print("   {:<6} n={:>3} running={:>3}  S(14)={:.3f}  S(30)={:.3f}"
              .format(name, len(sub), run, surv_at(c, 14), surv_at(c, 30)))
    alive = [a for a in ads if a[1] == 0 and a[0] >= 30]
    st = len([a for a in alive if a[2]])
    print("C. running and >= 30 days old: {} ads, {} steady ({:.3f})".format(
        len(alive), st, st / len(alive)))
    print("   base rate of steady among all ads: {:.3f}".format(
        len([a for a in ads if a[2]]) / N))
    print("   log check: ln S_KM(30) = {:.4f}".format(
        math.log(surv_at(km, 30))))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《公开广告库金主反查、B2B冷触达进箱物理与高客单暗投签单母典》第 1 章「在投时长:广告库里的生存曲线」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-347 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026347,
  author    = {Fan, Yafu},
  title     = {Active Ad-Library Prospecting, B2B Outbound Deliverability Physics and High-Ticket Whitelist Deal Closing},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论