5D Library › 回溯信念锁定、序贯痛点唤醒与马尔可夫升单自动机 · English

第五章 三级火箭:测算、学堂与牌照的吸收马尔可夫链

状态与转移

作者提纲中的「三级火箭」是:用户先付费测算,再报名命理学堂学会自己排盘,最后购买商业算命馆的 SaaS 牌照。把一个月作为一步,这条路径就是一条吸收马尔可夫链 (Kemeny and Snell 1960)。暂态是 V(访客)、T(已付费的测算用户)、C(学堂学员);吸收态是 L(牌照持有者)与 X(流失)。

三级火箭的状态与每月转移概率。

记暂态之间的转移矩阵为 QQ,暂态到吸收态的矩阵为 RR。基本矩阵 N=(I−Q)−1N = (I – Q)^{-1} 的第 (i,j)(i, j) 个元素,是从 ii 出发、在吸收之前停留在 jj 的期望月数;B=NRB = N R 给出被各吸收态吸收的概率。把每月的收入(T 的复购测算 25,C 的学费分期 60)与进入 L 时的牌照价格(取第 68 本的 12,537)按每月 0.99 贴现,就得到生命周期价值(LTV)。

计算

推导

# Chapter 5. [p09] Reading -> academy course -> licence as an absorbing
# Markov chain (one step = one month). Transient states: V visitor,
# T reader (has paid for a reading), C student (in the academy course).
# Absorbing states: L licensee, X lapsed. Rewards: 25 a month in T
# (repeat readings), 60 a month in C (course instalments), 12,537 on
# entering L (the licence price of Vol. 68). Monthly discount 0.99.
# Fundamental matrix N = (I - 0.99 Q)^-1 for discounted values and
# (I - Q)^-1 for counts.
STATES = ("V", "T", "C")
Q = ((0.55, 0.05, 0.00),
     (0.00, 0.70, 0.04),
     (0.00, 0.00, 0.80))
R = ((0.000, 0.40),          # to L, to X
     (0.002, 0.258),
     (0.030, 0.17))
STAY = (0.0, 25.0, 60.0)
ENTRY_L = 12537.0

def inverse(m):
    n = len(m)
    a = [list(row) + [1.0 if i == j else 0.0 for j in range(n)]
         for i, row in enumerate(m)]
    for c in range(n):
        piv = max(range(c, n), key=lambda r: abs(a[r][c]))
        a[c], a[piv] = a[piv], a[c]
        f = a[c][c]
        a[c] = [x / f for x in a[c]]
        for r in range(n):
            if r != c:
                g = a[r][c]
                a[r] = [x - g * y for x, y in zip(a[r], a[c])]
    return [row[n:] for row in a]

def fundamental(delta):
    return inverse([[(1.0 if i == j else 0.0) - delta * Q[i][j]
                     for j in range(3)] for i in range(3)])

def mul(a, b):
    return [[sum(a[i][k] * b[k][j] for k in range(len(b)))
             for j in range(len(b[0]))] for i in range(len(a))]

if __name__ == "__main__":
    n = fundamental(1.0)
    b = mul(n, R)
    nd = fundamental(0.99)
    bd = mul(nd, [[0.99 * r[0]] for r in R])
    print("   from  P(licence)  P(lapse)  months to absorption  LTV")
    for i, s in enumerate(STATES):
        months = sum(n[i])
        ltv = sum(nd[i][j] * STAY[j] for j in range(3)) + \
            bd[i][0] * ENTRY_L
        print("   {:4s} {:11.4f} {:9.4f} {:21.2f} {:9.2f}".format(
            s, b[i][0], b[i][1], months, ltv))
    print("   expected months as reader / student, from T: {:.2f} / {:.2f}"
          .format(n[1][1], n[1][2]))
    parts = (nd[1][1] * STAY[1], nd[1][2] * STAY[2], bd[1][0] * ENTRY_L)
    print("   LTV from T = readings {:.2f} + course {:.2f} + licence {:.2f}"
          .format(*parts))
    print("   LTV multiplier on a first reading of 99: {:.2f}".format(
        sum(parts) / 99))
    print("\nReading: a reader becomes a licensee with probability of")
    print("under three in a hundred here, yet that path carries most of")
    print("her lifetime value; the repeat readings carry the rest.")
#    from  P(licence)  P(lapse)  months to absorption  LTV
#    V         0.0030    0.9970                  2.67     46.77
#    T         0.0267    0.9733                  4.00    430.41
#    C         0.1500    0.8500                  5.00   2078.60
#    expected months as reader / student, from T: 3.33 / 0.67
#    LTV from T = readings 81.43 + course 37.21 + licence 311.77
#    LTV multiplier on a first reading of 99: 4.35
#
# Reading: a reader becomes a licensee with probability of
# under three in a hundred here, yet that path carries most of
# her lifetime value; the repeat readings carry the rest.

从访客出发,最终成为牌照持有者的概率是 0.0030,平均 2.67 个月内被吸收,LTV 为 46.77。从测算用户出发,成为牌照持有者的概率是 0.0267,LTV 为 430.41,是首单 99 的 4.35 倍。这 430.41 中,复购测算贡献 81.43,学费贡献 37.21,牌照贡献 311.77:概率不到百分之三的那条路,贡献了约四分之三的价值。

哪一环最值得改进

程序把每一个转移概率提高 0.005(从同一行的流失中扣除),看访客与测算用户的 LTV 各增加多少。

推导

# Chapter 5. [p10] Which link of the funnel is worth improving?
# The chain of p09. Each transition is raised by 0.005 (absolute), the
# probability taken from lapsing in the same row; reported is the
# change in the discounted LTV of a visitor (state V) and of a reader
# (state T).
Q0 = ((0.55, 0.05, 0.00),
      (0.00, 0.70, 0.04),
      (0.00, 0.00, 0.80))
R0 = ((0.000, 0.40),
      (0.002, 0.258),
      (0.030, 0.17))
STAY = (0.0, 25.0, 60.0)
ENTRY_L = 12537.0

def solve(q, r, delta=0.99):
    # discounted values by iteration (the chain is short-lived)
    v = [0.0, 0.0, 0.0]
    for _ in range(2000):
        v = [STAY[i] + delta * (sum(q[i][j] * v[j] for j in range(3))
                                + r[i][0] * ENTRY_L) for i in range(3)]
    return v

def bump(link):
    q = [list(x) for x in Q0]
    r = [list(x) for x in R0]
    i, j = link
    d = 0.005
    if j == "L":
        r[i][0] += d
    else:
        q[i][j] += d
    r[i][1] -= d
    return q, r

if __name__ == "__main__":
    base = solve(Q0, R0)
    print("   LTV of a visitor {:.2f}, of a reader {:.2f}".format(
        base[0], base[1]))
    print("   link +0.005     visitor LTV change   reader LTV change")
    links = ((("V -> T"), (0, 1)), (("T -> C"), (1, 2)),
             (("T -> L"), (1, "L")), (("C -> L"), (2, "L")),
             (("T stays"), (1, 1)), (("C stays"), (2, 2)))
    for name, link in links:
        v = solve(*bump(link))
        print("   {:15s} {:12.2f} {:19.2f}".format(
            name, v[0] - base[0], v[1] - base[1]))
    print("\nReading: per unit of probability, the direct links into the")
    print("licence are worth by far the most; of the softer links, the")
    print("step from reader to student beats keeping readers longer.")
#    LTV of a visitor 46.77, of a reader 430.41
#    link +0.005     visitor LTV change   reader LTV change
#    V -> T                  4.68                0.00
#    T -> C                  3.64               33.51
#    T -> L                 21.97              202.14
#    C -> L                  4.18               38.49
#    T stays                 0.77                7.05
#    C stays                 0.71                6.54
#
# Reading: per unit of probability, the direct links into the
# licence are worth by far the most; of the softer links, the
# step from reader to student beats keeping readers longer.

按每单位概率计,直接通向牌照的两条边最值钱:测算用户直接取得牌照的概率提高 0.005,读者的 LTV 增加 202.14;学员取得牌照提高同样幅度,增加 38.49。在较「软」的环节中,从测算用户到学员(33.51)远胜于让测算用户多留一段时间(7.05)。对访客而言,第一次付费(4.68)与学员到牌照(4.18)大致同等重要。

假说 · 尚未验证

作者的诠释(尚未验证): 在作者的业务中,学堂的主要作用不是学费收入,而是把一小部分测算用户转化为从业者,并最终转化为牌照持有者。什么会证明这一判断错:若真实数据中学员到牌照的月转化率远低于本章的 0.030(例如低于 0.005),学堂对 LTV 的贡献就主要来自学费,本章对「三级火箭」的估值需要大幅下调。

小结

把「测算、学堂、牌照」写成吸收马尔可夫链后,转化概率、停留时间与 LTV 都有闭式解。在本章的参数下,测算用户的 LTV 是首单的 4.35 倍,其中约四分之三来自概率不到百分之三的牌照之路;最值得改进的是通向牌照的两条边,其次是测算用户到学员的一步。

参考文献

Kemeny, John G., and J. Laurie Snell. 1960. Finite Markov Chains. Van Nostrand.

Fan, Y. (2026). Retrodictive Belief Locking, Sequential Pain-Point Agitation and Markovian Upsell Automata: Bayesian Trust Avalanches, Sunk-Cost Commitment Ratchets and Cross-Domain Transition Matrices [回溯信念锁定、序贯痛点唤醒与马尔可夫升单自动机] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090186 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).