5D Library › 分销网络幂律激活、网红矩阵组合优化与激励稳定边界 · English

第八章 实践:全年账本、集中度监测与预先登记的激活实验

一年的账本:佣金何时付

p14 为一个单层分销计划建立十二个月的账本:零售额每月增长约 4%,商品成本 20%,运费 10%,支付手续费 3%,佣金 50%,6% 的订单在三十天内退款。比较两种付佣规则:成交即付(退款后再追讨,只能追回四成),或在退款期过后再付。

推导

# Chapter 8. p14: A year's ledger for a single-tier programme. Retail
# sales through affiliates start at RM 200,000 a month and grow 4% a
# month, with noise (sd 10%). Cost of goods 20%, shipping 10%, payment
# fees 3%, commission 50%. 6% of sales are refunded within 30 days. Two
# payout rules: pay commission at once (and try to claw back on refund,
# recovering only 40%), or hold it 30 days past the refund window. Also
# an activation bonus of RM 20 for 120 first sales a month. Seed 87.
import random

if __name__ == "__main__":
    rng = random.Random(87)
    print("   month   sales (RM)   refunds   contribution, pay at once"
          "   hold 30 days")
    tot = [0.0] * 4
    for m in range(1, 13):
        sales = 200000.0 * 1.04 ** (m - 1) * (1 + rng.gauss(0, 0.10))
        refund = 0.06 * sales
        kept = sales - refund
        base = kept * (1 - 0.20 - 0.10) - 0.03 * sales - 120 * 20
        held = base - 0.5 * kept
        at_once = base - 0.5 * sales + 0.4 * 0.5 * refund
        for i, v in enumerate((sales, refund, at_once, held)):
            tot[i] += v
        if m in (1, 6, 12):
            print("   {:5d}   {:10,.0f}   {:7,.0f}   {:25,.0f}   {:12,.0f}"
                  .format(m, sales, refund, at_once, held))
    print("   year    {:10,.0f}   {:7,.0f}   {:25,.0f}   {:12,.0f}"
          .format(*tot))
    print("   commission lost to refunds when paid at once: RM {:,.0f}"
          .format(tot[3] - tot[2]))
    print("   contribution margin (held): {:.3f}".format(tot[3] / tot[0]))
#    month   sales (RM)   refunds   contribution, pay at once   hold 30 days
#        1      207,877    12,473                      26,703         30,445
#        6      264,916    15,895                      34,688         39,457
#       12      326,591    19,595                      43,323         49,201
#    year     2,989,300   179,358                     389,702        443,509
#    commission lost to refunds when paid at once: RM 53,807
#    contribution margin (held): 0.148

全年零售额 2,989,300 令吉,退款 179,358 令吉。成交即付时全年贡献是 389,702 令吉,延后付佣是 443,509 令吉,差额 53,807 令吉,就是付给了日后退款订单、又追不回来的佣金。延后付佣后的贡献率是 0.148。佣金的结算周期应当晚于退款期,这一条比任何激励设计都更直接地影响利润。

集中度的月度监测

p15 为两千五百名活跃分销员按月计算赫芬达尔指数(HHI)(Rhoades 1993)、等效销售者人数(HHI 的倒数)以及前 1 名与前 10 名的份额。

推导

# Chapter 8. p15: Watching concentration month by month. 2,500 active
# affiliates; each has a lasting level 10 x Lomax(1.5) (p02) and a
# monthly lognormal swing (log sd 0.5). Each month: the Herfindahl index
# HHI = sum of squared sales shares, the effective number of sellers
# 1 / HHI, and the shares of the top 1 and top 10. Then the revenue at
# risk if the top 1 or top 10 left. 12 months, seed 87.
import random
from math import exp

if __name__ == "__main__":
    rng = random.Random(87)
    level = [10.0 * ((1 - rng.random()) ** (-1 / 1.5) - 1)
             for _ in range(2500)]
    print("   month   HHI      effective sellers   top 1    top 10")
    rows = []
    for m in range(1, 13):
        s = [x * exp(rng.gauss(-0.125, 0.5)) for x in level]
        tot = sum(s)
        sh = sorted((x / tot for x in s), reverse=True)
        hhi = sum(x * x for x in sh)
        rows.append((hhi, 1 / hhi, sh[0], sum(sh[:10])))
        if m in (1, 4, 8, 12):
            print("   {:5d}   {:.4f}   {:17.0f}   {:.3f}   {:.3f}".format(
                m, *rows[-1]))
    lo = min(r[1] for r in rows)
    hi = max(r[1] for r in rows)
    print("   effective sellers over the year: {:.0f} to {:.0f} of 2,500"
          .format(lo, hi))
    print("   revenue at risk: top 1 leaves {:.3f}, top 10 leave {:.3f}"
          .format(sum(r[2] for r in rows) / 12, sum(r[3] for r in rows) / 12))
#    month   HHI      effective sellers   top 1    top 10
#        1   0.0071                 141   0.060   0.181
#        4   0.0066                 151   0.056   0.183
#        8   0.0066                 152   0.061   0.167
#       12   0.0130                  77   0.095   0.237
#    effective sellers over the year: 76 to 163 of 2,500
#    revenue at risk: top 1 leaves 0.069, top 10 leave 0.202

等效销售者人数在一年中从 76 到 163 之间波动:两千五百名活跃者在集中度上相当于一百多人。若最大的一位离开,平均损失 0.069 的收入;前十名离开,损失 0.202。第十二个月 HHI 突然升高,只是因为一位顶尖销售者那个月表现特别好:重尾意味着集中度本身也会大幅跳动,单月的读数不能当作趋势。

注

监测规矩: 按月报告等效销售者人数与前十名份额,用三个月移动平均判断趋势;为前十名分别建立留存计划;任何单一分销员的份额超过一成时,检查是否存在刷单或自买。

预先登记的激活实验

第二章的假说需要实验检验:把新进分销员随机分为无奖励与 20 令吉首单奖励两组。p16 用第二章的队列参数计算所需样本量。

推导

# Chapter 8. p16: Sample size for a pre-registered test of the RM 20
# activation bonus of p03. Primary end point: the 30-day activation
# rate, compared as two proportions. Secondary end point: 12-month
# margin per recruit, whose spread is large because most recruits bring
# nothing and a few bring a lot. Both sized for a two-sided alpha of 0.05
# and power 0.80, using p03's cohort (seed 87) for the inputs:
# n = (1.96 sqrt(2 pb qb) + 0.84 sqrt(p1 q1 + p2 q2))^2 / d^2 per arm
# for rates, and n = 2 (1.96 + 0.84)^2 sd^2 / d^2 per arm for means.
import importlib.util
import random
from math import ceil, exp, sqrt

def load(name):
    spec = importlib.util.spec_from_file_location(name, name + ".py")
    m = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(m)
    return m

p03 = load("p03_activation_bonus")

def margins(people, bonus):
    out = []
    for z, u in people:
        on = u < p03.logistic(-1.5 + z + 0.01 * bonus)
        out.append(120.0 * exp(0.8 * z - 0.32) if on else 0.0)
    return out

if __name__ == "__main__":
    people = p03.cohort(random.Random(87))
    a, b = margins(people, 0), margins(people, 20)
    p1 = sum(1 for x in a if x) / len(a)
    p2 = sum(1 for x in b if x) / len(b)
    pb = (p1 + p2) / 2
    n_rate = ceil((1.96 * sqrt(2 * pb * (1 - pb)) + 0.84 * sqrt(
        p1 * (1 - p1) + p2 * (1 - p2))) ** 2 / (p2 - p1) ** 2)
    m1, m2 = sum(a) / len(a), sum(b) / len(b)
    sd = sqrt(sum((x - m1) ** 2 for x in a) / (len(a) - 1))
    n_mean = ceil(2 * (1.96 + 0.84) ** 2 * sd ** 2 / (m2 - m1) ** 2)
    print("   activation: {:.3f} vs {:.3f}; recruits per arm {:,d}".format(
        p1, p2, n_rate))
    print("   margin per recruit (RM): {:.1f} vs {:.1f}, sd {:.1f};"
          " recruits per arm {:,d}".format(m1, m2, sd, n_mean))
    print("   ratio of sample sizes: {:.1f}".format(n_mean / n_rate))
#    activation: 0.220 vs 0.253; recruits per arm 2,506
#    margin per recruit (RM): 44.3 vs 49.3, sd 115.2; recruits per arm 8,303
#    ratio of sample sizes: 3.3

以三十天激活率为主要终点(0.220 对 0.253),每组需要 2,506 人;若以十二个月每人毛利为终点(44.3 对 49.3 令吉,标准差 115.2),每组需要 8,303 人,是前者的 3.3 倍。原因是毛利的分布重尾:多数人贡献为零,少数人贡献很大。登记方案时应以激活率为主要终点,毛利为次要终点,并事先说明只有在毛利终点的样本量也达到时才对盈亏下结论。

假说 · 尚未验证

作者的诠释(尚未验证): 20 令吉的首单奖励能把三十天激活率提高约三个百分点,但扣除奖励支出后的十二个月毛利与无奖励组没有显著差别。什么会证明它错: 预先登记的实验显示激活率没有显著提高,或扣除奖励后的毛利显著高于(或低于)无奖励组。

小结

佣金延后到退款期之后再付,在示意账本中每年多留下五万多令吉;集中度应按月监测、按季判断,并为头部分销员单独规划留存;激活奖励的实验以激活率为主要终点,所需样本量只有毛利终点的约三分之一。

参考文献

Rhoades, Stephen A. 1993. “The Herfindahl-Hirschman Index.” Federal Reserve Bulletin 79 (3): 188 to 189.

Fan, Y. (2026). Affiliate Network Power Laws, Influencer Portfolio Optimization and Incentive Stability Bounds: Heavy-Tailed Productivity, Markowitz Traffic Allocation and Single-Tier Commission Equilibria [分销网络幂律激活、网红矩阵组合优化与激励稳定边界] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090229 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).