5D Library › 多层条件激发系统中的幂律权重与逆向控制可及性 · English
第二章 方差贡献:作者的权重与三种拆分
作者的权重
作者为五层指定了一组自上而下递减的「方差贡献度」: 50%、 25%、 12.5%、 7.5%、 5%,并称之为「二进幂律」。这组数字表达的直觉很清楚:越靠上的层分量越重,而且是成倍地重。本章先核对这组数字本身,再问一个更基本的问题:在什么意义上,可以说某一层「贡献了」多少方差?
注
这些权重是作者的假设,不是实证估计。 没有任何已发表的研究对这五层同时测量并得出这组数字;第三、四章汇总的证据也只涉及各层中某些可以测量的部分。本书把这组权重当作一个可以讨论的模型参数,而不是事实。
推导
程序列出作者的权重、严格的二进序列 ()、把二进序列归一化到 100% 的版本,以及让最后一层吸收剩余部分的版本;再与真正的幂律 比较。在对数尺度的加法模型中,若各层独立,第 层的份额是 ,所以份额也决定了相邻两层标准差之比。
# The author's "binary power-law" variance shares for the five layers (Chapter 2).
# A strict halving sequence 2^-k is compared with the author's 50/25/12.5/7.5/5, and with
# a true power law w_k proportional to k^-a. In an additive model on the log scale with
# independent layers, share_k = sigma_k^2 / sum sigma^2, so the shares fix the SD ratios.
import math
author = [50.0, 25.0, 12.5, 7.5, 5.0]
dyadic = [100 / 2 ** k for k in range(1, 6)]
s = sum(dyadic)
print("layer author strict 2^-k 2^-k renormalised last layer takes the rest")
rest = dyadic[:4] + [100 - sum(dyadic[:4])]
for k in range(5):
print(f" C{k + 1} {author[k]:9.2f} {dyadic[k]:13.3f} {100 * dyadic[k] / s:19.2f}"
f" {rest[k]:27.3f}")
print(f" sum {sum(author):8.2f} {s:13.3f} {100.0:19.2f} {sum(rest):27.3f}")
print("ratios of neighbouring shares:")
print(" author: " + " ".join(f"{a / b:.2f}" for a, b in zip(author, author[1:])))
print(" 2^-k: " + " ".join(f"{a / b:.2f}" for a, b in zip(dyadic, dyadic[1:])))
print("SD ratio between neighbouring layers implied (independent layers, log scale):")
print(" author: "
+ " ".join(f"{math.sqrt(a / b):.3f}" for a, b in zip(author, author[1:])))
print(f" 2^-k: {math.sqrt(2):.3f} at every step")
print("geometric (2^-k) versus power law (k^-a), both normalised to 100:")
for a in (1.0, 2.0):
w = [k ** -a for k in range(1, 6)]
print(f" k^-{a:.0f}: " + " ".join(f"{100 * x / sum(w):5.1f}" for x in w))
w = [2.0 ** -k for k in range(1, 6)]
print(" 2^-k: " + " ".join(f"{100 * x / sum(w):5.1f}" for x in w))
print("log-log slope of 2^-k between k = 1 and k = 5: "
f"{(math.log(w[4]) - math.log(w[0])) / (math.log(5) - math.log(1)):.2f};"
f" between k = 4 and 5: {(math.log(w[4]) - math.log(w[3])) / math.log(5 / 4):.2f}")
# layer author strict 2^-k 2^-k renormalised last layer takes the rest
# C1 50.00 50.000 51.61 50.000
# C2 25.00 25.000 25.81 25.000
# C3 12.50 12.500 12.90 12.500
# C4 7.50 6.250 6.45 6.250
# C5 5.00 3.125 3.23 6.250
# sum 100.00 96.875 100.00 100.000
# ratios of neighbouring shares:
# author: 2.00 2.00 1.67 1.50
# 2^-k: 2.00 2.00 2.00 2.00
# SD ratio between neighbouring layers implied (independent layers, log scale):
# author: 1.414 1.414 1.291 1.225
# 2^-k: 1.414 at every step
# geometric (2^-k) versus power law (k^-a), both normalised to 100:
# k^-1: 43.8 21.9 14.6 10.9 8.8
# k^-2: 68.3 17.1 7.6 4.3 2.7
# 2^-k: 51.6 25.8 12.9 6.5 3.2
# log-log slope of 2^-k between k = 1 and k = 5: -1.72; between k = 4 and 5: -3.11核对的结果有三点。第一,严格的二进序列是 50、25、12.5、6.25、3.125,合计 96.875%,剩下 3.125% 没有着落;作者的 7.5 与 5 不是二进的,前两个相邻之比是 2,后两个分别是 1.67 与 1.5。作者的数字是一个让总和凑满 100% 的近似。如果要保持严格的「逐层减半」,有两种自洽的选择:把序列归一化(51.6、25.8、12.9、6.5、3.2),或者让最后一层吸收剩余部分(50、25、12.5、6.25、6.25)。第二, 是几何级数(对层号 呈指数衰减),不是幂律:幂律 在双对数坐标中是一条直线,而 在双对数坐标中越来越陡(从第 1 层到第 5 层的平均斜率为 −1.72,第 4 到第 5 层之间为 −3.11)。取 的幂律给出 43.8、21.9、14.6、10.9、8.8,与二进序列在底层相差很大。第三,在独立、对数可加的模型中,「逐层减半的方差」意味着「逐层除以 的标准差」:这是一个关于各层离散程度的具体主张,原则上可以检验。
本书保留作者在书名中使用的「幂律权重」一词,但在正文中称之为「几何权重」或「作者的权重」;正文以作者原稿的 50/25/12.5/7.5/5 为讨论对象,同时列出另外三套数字供对照。
方差贡献依赖什么
即使各层的方差已知,「每层贡献多少」也只有在层与层互不相关时才有唯一的答案。现实中各层很可能相关:在某种环境中长大的人,先天先验与环境相关;声誉好的人更容易进入好的网络,环境与声誉相关;知识投入又影响声誉。一旦相关,共享的那部分方差该算给谁,就取决于拆分的规则。
证据
相对重要性的拆分方法。 林德曼、梅伦达与戈尔德提出:对回归中的每个预测变量,计算它在所有可能的进入顺序下带来的 增量,再取平均(LMG 方法) (Lindeman et al. 1980)。这等于合作博弈中的沙普利值:把 看作各变量「合作」得到的总收益,按每个变量在所有排列中的平均边际贡献分配 (Shapley 1953)。格勒姆平比较了基于方差分解的几种相对重要性估计量,指出它们回答的是不同的问题,不存在一个对所有目的都正确的拆分 (Grömping 2007)。对非线性模型,索博尔把输出方差分解为各输入及其交互作用的贡献(索博尔指数) (Sobol’ 2001);欧文证明,对独立输入,沙普利效应等于把每个交互项的方差平均分给参与交互的各个输入 (Owen 2014)。
推导
在对数可加的模型 中,令各层的方差恰好是作者的权重(若独立,份额就是 50/25/12.5/7.5/5),再加入几组示意的相关:(先验与成长环境相关)、、、。比较四种拆分:各层自身方差占总方差的比例、自上而下依次进入的 增量、自下而上依次进入的增量,以及沙普利值(LMG,对 120 种顺序取平均)。
# How much of the variance of ln S = x1 + ... + x5 does each layer "explain"? (Ch. 2)
# Layer SDs are set so that, IF the layers were independent, the shares would be the
# author's 50/25/12.5/7.5/5; then illustrative correlations are added. Four splits of R^2:
# own variance var(x_k)/var(ln S); R^2 gained entering top-down (C1 first); bottom-up
# (C5 first); Shapley / LMG = average gain over all 120 orders (Lindeman, Merenda & Gold).
import math, itertools
def solve(M, v):
n = len(v); A = [row[:] + [v[i]] for i, row in enumerate(M)]
for c in range(n):
p = max(range(c, n), key=lambda r: abs(A[r][c])); A[c], A[p] = A[p], A[c]
for r in range(n):
if r != c: A[r] = [a - A[r][c] / A[c][c] * b for a, b in zip(A[r], A[c])]
return [A[i][n] / A[i][i] for i in range(n)]
def shares(cov):
n = len(cov); c = [sum(row) for row in cov]; vy = sum(c); memo = {}
def R(S): # R^2 of ln S regressed on the layers in S
key = frozenset(S)
if key not in memo:
S = sorted(S)
b = solve([[cov[i][j] for j in S] for i in S], [c[i] for i in S]) if S else []
memo[key] = sum(bi * c[i] for bi, i in zip(b, S)) / vy
return memo[key]
def seq(order):
out, have = [0.0] * n, []
for k in order: out[k] = R(have + [k]) - R(have); have.append(k)
return out
orders = list(itertools.permutations(range(n)))
shap = [sum(g) / len(orders) for g in zip(*(seq(o) for o in orders))]
return ([cov[k][k] / vy for k in range(n)], seq(range(n)), seq(range(n - 1, -1, -1)),
shap)
def covariance(sd, corr):
R = [[1.0 if i == j else corr.get((min(i, j), max(i, j)), 0.0) for j in range(5)]
for i in range(5)]
return [[R[i][j] * sd[i] * sd[j] for j in range(5)] for i in range(5)]
SD = [math.sqrt(w) for w in (0.50, 0.25, 0.125, 0.075, 0.05)]
CORR = {(0, 2): 0.4, (2, 3): 0.5, (3, 4): 0.4, (0, 4): 0.3}
if __name__ == "__main__":
for title, corr in (("independent layers", {}), ("correlated layers: " + ", ".join(
f"r(C{i + 1},C{j + 1}) = {r}" for (i, j), r in CORR.items()), CORR)):
own, td, bu, sh = shares(covariance(SD, corr))
print(title)
print(" layer own var top-down bottom-up Shapley/LMG")
for k in range(5):
print(f" C{k + 1} {own[k]:7.1%} {td[k]:9.1%} {bu[k]:10.1%} {sh[k]:12.1%}")
print(f" sum {sum(own):7.1%} {sum(td):9.1%} {sum(bu):10.1%} {sum(sh):12.1%}")
# independent layers
# layer own var top-down bottom-up Shapley/LMG
# C1 50.0% 50.0% 50.0% 50.0%
# C2 25.0% 25.0% 25.0% 25.0%
# C3 12.5% 12.5% 12.5% 12.5%
# C4 7.5% 7.5% 7.5% 7.5%
# C5 5.0% 5.0% 5.0% 5.0%
# sum 100.0% 100.0% 100.0% 100.0%
# correlated layers: r(C1,C3) = 0.4, r(C3,C4) = 0.5, r(C4,C5) = 0.4, r(C1,C5) = 0.3
# layer own var top-down bottom-up Shapley/LMG
# C1 34.7% 58.2% 20.0% 39.2%
# C2 17.4% 17.4% 17.4% 17.4%
# C3 8.7% 13.7% 33.4% 22.3%
# C4 5.2% 8.8% 8.6% 10.3%
# C5 3.5% 2.0% 20.6% 10.9%
# sum 69.4% 100.0% 100.0% 100.0%各层独立时,四种方法给出完全相同的数字。加入相关之后,答案分道扬镳: 的份额自上而下是 58.2%,自下而上是 20.0%,沙普利值是 39.2%; 的份额自上而下只有 2.0%,自下而上是 20.6%,沙普利值是 10.9%。「各层自身方差」的份额加起来只有 69.4%,因为相关使总方差大于各层方差之和。
这说明了一件重要的事:按自上而下的顺序拆分,会系统地把共享的方差算给上层。 如果一个人先认定「先天最重要」,然后把先天放在第一位做回归,得到的大份额在很大程度上是顺序的产物。沙普利值对所有顺序一视同仁,是一个更公平的约定,但它仍然是一个约定,不是自然规律。
尺度:对数还是原始
上面的分解在对数尺度上进行。乘法模型在原始尺度上不可加: 含有各层的交互作用,同样的模型换一个尺度,份额也会变。
推导
设 独立,方差为 ,其中 是作者的权重, 是 的总方差。对数尺度上的份额恰好是 。在原始尺度上,用索博尔—霍夫丁分解计算一阶指数(只算各层单独的作用)、总效应指数(包括它参与的所有交互作用)与沙普利效应(把每个交互项平分给参与者),比较 、、 三种离散程度(表中列出 与 )。
# The same multiplicative model, decomposed on two scales (Chapter 2).
# S = f1 f2 f3 f4 f5 with independent ln f_k ~ N(0, w_k V): on the log scale the shares
# are exactly the weights w_k (author's 50/25/12.5/7.5/5). On the raw scale S itself has
# interactions. For independent inputs the Sobol'-Hoeffding (ANOVA) term of a set u of
# layers has variance V_u = prod_{j not in u} mu_j^2 * prod_{j in u} v_j, where mu_j and
# v_j are the mean and variance of f_j. First-order index: V_{k} / Var S; total index:
# sum of V_u over u containing k; Shapley effect (Owen 2014): each V_u split equally
# among the |u| layers it involves.
import math, random, itertools
W = [0.50, 0.25, 0.125, 0.075, 0.05]
def indices(V):
s2 = [w * V for w in W]
mu = [math.exp(s / 2) for s in s2]
var = [math.exp(2 * s) - math.exp(s) for s in s2]
terms = {}
for r in range(1, 6):
for u in itertools.combinations(range(5), r):
terms[u] = math.prod(var[j] if j in u else mu[j] ** 2 for j in range(5))
tot = sum(terms.values())
first = [terms[(k,)] / tot for k in range(5)]
total = [sum(v for u, v in terms.items() if k in u) / tot for k in range(5)]
shap = [sum(v / len(u) for u, v in terms.items() if k in u) / tot for k in range(5)]
return first, total, shap, tot, 1 - sum(first)
if __name__ == "__main__":
print("V = Var(ln S); raw scale: first-order, total and Shapley indices of C1 and C5")
print(" V Var(S) interactions | C1: first total Shapley | C5: first total"
" Shapley")
for V in (0.25, 1.0, 2.0):
first, total, shap, tot, inter = indices(V)
print(f" {V:4.2f} {tot:8.3f} {inter:11.1%} |"
+ " |".join(f" {first[k]:6.1%} {total[k]:6.1%} {shap[k]:7.1%}"
for k in (0, 4)))
print("log-scale shares (all V): " + " ".join(f"{w:.1%}" for w in W))
rng = random.Random(41); V = 1.0
xs = [math.prod(math.exp(rng.gauss(0, math.sqrt(w * V))) for w in W)
for _ in range(200000)]
m = sum(xs) / len(xs); mc = sum((x - m) ** 2 for x in xs) / len(xs)
print(f"Monte Carlo check (V = 1, 200,000 draws): Var(S) = {mc:.3f}"
f" (exact {indices(1.0)[3]:.3f})")
# V = Var(ln S); raw scale: first-order, total and Shapley indices of C1 and C5
# V Var(S) interactions | C1: first total Shapley | C5: first total Shapley
# 0.25 0.365 8.1% | 46.9% 53.1% 50.0% | 4.4% 5.6% 5.0%
# 1.00 4.671 30.5% | 37.8% 62.2% 49.3% | 3.0% 7.7% 5.1%
# 2.00 47.209 54.3% | 26.9% 73.1% 47.5% | 1.6% 11.0% 5.4%
# log-scale shares (all V): 50.0% 25.0% 12.5% 7.5% 5.0%
# Monte Carlo check (V = 1, 200,000 draws): Var(S) = 4.753 (exact 4.671)离散程度小时(),原始尺度上的交互作用只占 8.1%, 与 的三种指数都接近作者的权重。离散程度大时,交互作用迅速变大: 时占 30.5%, 时占 54.3%。这时 的一阶指数只有 26.9%,总效应指数却有 73.1%;两者之差就是 与其他层的交互作用,而交互作用「属于谁」没有唯一的答案。沙普利效应把交互项平分,结果仍接近对数尺度上的权重(47.5%)。蒙特卡洛模拟的 为 4.753,与精确值 4.671 相符(对数正态的方差估计收敛很慢)。
这对作者的框架有一个直接的含义:在乘法模型中,「上层的方差贡献大」与「下层的作用依赖上层」是同一枚硬币的两面。交互作用越强,「这一层贡献了多少」越取决于你怎样分配交互项,越不像一个可以单独测量的量。
假说 · 尚未验证
几何权重假说(作者的假说,尚未确立)。在对数职业结局中,按沙普利值拆分的五层份额大致呈几何递减(相邻两层之比接近 2)。可以检验的预测:在一个对五层都有合理测量的大样本中,预先登记测量方法与沙普利拆分,相邻层份额之比的置信区间包含 2,而且排序与作者的层序一致。如果份额的排序与作者的层序明显不同(例如环境层大于先验层),或者相邻之比远离 2,这一假说就被否定。需要事先说明:份额依赖测量的信度,测得越粗的层份额越小,这一偏差必须在方案中处理。
本章小结
作者的 50/25/12.5/7.5/5 不是严格的二进序列(严格序列合计 96.875%), 也不是幂律而是几何级数;这组数字是作者的假设,不是实证估计。各层独立时,所有拆分方法给出相同的份额;层与层一旦相关,份额就取决于拆分规则,自上而下的顺序会系统地偏向上层,沙普利值(LMG)是对所有顺序取平均的约定。乘法模型在原始尺度上含有交互作用,离散越大,交互越重要,份额越依赖尺度与约定。下一章看已发表的研究对先天与时机能说什么。
参考文献
Fan, Y. (2026). Power-Law Weighting and Bottom-Up Controllability in Multi-Tier Conditional Excitation Systems: A Mathematical Synthesis of Endogenous Priors, Timing Windows, Network Topology and Reputational Games [多层条件激发系统中的幂律权重与逆向控制可及性] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23810093 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).