关于「沙堆与大缓和:自组织临界性」,《信贷周期与市场临界性》给出的定量结论是什么?
结论:但图中也能看到两个问题。第一,在有限的网格中,雪崩规模有一个由网格大小决定的上限,大雪崩一端急剧截断,分布并不是一条直线。第二,估计出的指数随着拟合的下限 \(s_{\min}\) 从 2 提高到 10,从 1.30 升到 1.41。程序同时给出精确的离散最大似然估计(用赫尔维茨 ζ 函数归一化)与克劳塞特等人的近似公式;那个近似只在下限约为 6 以上时才准确,在这组数据中两者恰好一致。文献中二维沙堆模型雪崩规模指数的报告值不尽一致,它的标度性质至今仍有争议。「是不是幂律」「指数是多少」并不是看一眼双对数图就能回答的问题。
数据口径:本书不构成任何证券、指数或期权的买卖建议,不预测任何市场点位或时间。 八章与《周易·泰卦》「无平不陂,无往不复」「城复于隍」、《道德经》「反者道之动」「物壮则老」及《盐铁论·本议》关于平准的辩论并读,并指出并读的限度;最后给出一份观察市场状态与自身仓位脆弱性的四步核查表,以及一项比较「常规平均年化收益率披露」与「加上历史最大回撤和厚尾模拟路径的尾部披露」对杠杆产品配置比例影响的预注册随机对照实验方案(不预设方向,双侧检验,每组 235 人可分析、招募 277 人,判定规则写成代码)。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 1.30, 1.41, 10
| 40000 grains after warm-up: mean height 2.09 grains per site; 22560 caused no toppling; largest avalanche 8063 topplings | |
| avalanche size share of avalanches (logarithmic bins) | |
| 1-3 | 0.2450 ############### |
| 4-15 | 0.2014 ############ |
| 16-63 | 0.1899 ########### |
| 64-255 | 0.1677 ########## |
| 256-1023 | 0.1456 ######### |
| 1024-4095 | 0.0490 ### |
| 4096-16383 | 0.0014 |
| maximum-likelihood exponent for s > | 2: exact 1.30, approximation 1.30 (15161 avalanches) |
| maximum-likelihood exponent for s > | 5: exact 1.36, approximation 1.36 (12510 avalanches) |
| maximum-likelihood exponent for s > | 10: exact 1.41, approximation 1.41 (10771 avalanches) |
| the largest 1 % of avalanches account for 28% of all topplings |
核心公式
查看完整验算程序
# The Bak-Tang-Wiesenfeld (1987) sandpile on an L x L grid with open edges. Drop one grain on a random
# site; any site holding 4 or more grains topples, sending one grain to each neighbour (grains that
# leave the edge are lost). Avalanche size s = number of topplings caused by one grain.
# Nobody tunes the pile: driven slowly, it organises itself into a state with avalanches of all sizes.
import math, random
def sandpile(L=48, warm=10000, n=40000, seed=1):
rnd = random.Random(seed)
z = [[0] * L for _ in range(L)]
sizes = []
for k in range(warm + n):
i, j = rnd.randrange(L), rnd.randrange(L)
z[i][j] += 1
s, stack = 0, [(i, j)] if z[i][j] >= 4 else []
while stack:
a, b = stack.pop()
if z[a][b] < 4: continue
z[a][b] -= 4; s += 1
if z[a][b] >= 4: stack.append((a, b))
for c, d in ((a + 1, b), (a - 1, b), (a, b + 1), (a, b - 1)):
if 0 <= c < L and 0 <= d < L:
z[c][d] += 1
if z[c][d] == 4: stack.append((c, d))
if k >= warm: sizes.append(s)
return sizes, sum(map(sum, z)) / L ** 2
def mle_tau(xs, xmin):
"""Discrete power-law exponent, Clauset, Shalizi & Newman (2009) approximation, for x >= xmin.
The approximation is accurate only for xmin of about 6 or more; mle_exact below is exact."""
t = [x for x in xs if x >= xmin]
return 1 + len(t) / sum(math.log(x / (xmin - 0.5)) for x in t), len(t)
def hurwitz(tau, xmin, K=2000):
"""zeta(tau, xmin) = sum over k >= xmin of k^-tau: direct sum, then an Euler-Maclaurin tail."""
s = sum(k ** -tau for k in range(xmin, K))
return s + K ** (1 - tau) / (tau - 1) + 0.5 * K ** -tau + tau * K ** (-tau - 1) / 12
def mle_exact(xs, xmin):
"""Exact discrete MLE: maximise -tau * sum(ln x) - n ln zeta(tau, xmin) by golden-section search."""
t = [x for x in xs if x >= xmin]
n, sl = len(t), sum(math.log(x) for x in t)
f = lambda a: -a * sl - n * math.log(hurwitz(a, xmin))
lo, hi, g = 1.01, 3.0, (math.sqrt(5) - 1) / 2
for _ in range(60):
a, b = hi - g * (hi - lo), lo + g * (hi - lo)
if f(a) > f(b): hi = b
else: lo = a
return (lo + hi) / 2
if __name__ == "__main__":
sizes, dens = sandpile()
pos = [s for s in sizes if s > 0]
print(f"{len(sizes)} grains after warm-up: mean height {dens:.2f} grains per site; "
f"{len(sizes) - len(pos)} caused no toppling; largest avalanche {max(sizes)} topplings")
print("avalanche size share of avalanches (logarithmic bins)")
lo = 1
while lo <= max(pos):
hi = lo * 4
c = sum(1 for s in pos if lo <= s < hi)
print(f" {lo:6d}-{hi - 1:<6d} {c / len(pos):8.4f} " + "#" * round(60 * c / len(pos)))
lo = hi
for xmin in (2, 5, 10):
tau, m = mle_tau(pos, xmin)
print(f"maximum-likelihood exponent for s >= {xmin:2d}: exact {mle_exact(pos, xmin):.2f},"
f" approximation {tau:.2f} ({m} avalanches)")
top = sorted(sizes)[-len(sizes) // 100:]
print(f"the largest 1 % of avalanches account for {sum(top) / sum(sizes):.0%} of all topplings")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《信贷周期、自组织临界性与市场相变的统计物理》第 2 章「沙堆与大缓和:自组织临界性」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23754711
DOI: 10.5281/zenodo.23754711 · 阅读本章所在专著 · 5DL-B-020 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026020,
author = {Fan, Yafu},
title = {Credit Cycles, Self-Organised Criticality and the Statistical Physics of Market Phase Transitions},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23754711},
url = {https://doi.org/10.5281/zenodo.23754711}
}