关于「概率加权矩:只用标准库估计广义帕累托的两个参数」,《极值尾部与退单准备金》给出的定量结论是什么?
结论:第三章推导概率加权矩,50 个超额时其均方根误差 0.169,低于最大似然的 0.209。
数据口径:书中的订单、退单、请求量与参数均为示意;全部计算由书中程序生成;准备金与服务器冗余的讨论属于非个人化经营与财务方法,不构成理财、会计、税务或投资建议,实际金额与生产变更须由经营者人工决定。 第一章显示,在形状约 0.4 的示意订单尾部上,真实千分之一分位是正态估计的 2.57 倍,万分之一分位是 5.56 倍;样本上的正态估计中位数只有真实值的 0.363,最大的 20 笔订单占去离差平方和的 0.353。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.169, 0.209, 50
true xi 0.4; 1-in-1000 excess level 37.122; 300 reps
n | bias / rmse of xi: PWM mom ML
50 | -0.043 0.169 -0.160 0.200 -0.041 0.209
100 | -0.022 0.137 -0.124 0.157 -0.011 0.152
200 | -0.025 0.101 -0.102 0.128 -0.018 0.106
500 | -0.003 0.063 -0.064 0.088 +0.002 0.062
estimated / true 1-in-1000 level (5% 50% 95%)
50 0.28 0.81 2.75 0.25 0.60 1.47 0.24 0.84 3.69
100 0.37 0.92 2.23 0.34 0.67 1.34 0.36 0.94 3.01
200 0.49 0.89 1.85 0.43 0.69 1.20 0.49 0.92 2.09
500 0.68 0.98 1.58 0.57 0.80 1.23 0.69 1.00 1.61查看完整验算程序
# Chapter 3. p32: PWM, moments and ML on small samples of excesses.
# Model: excesses drawn from an exact GPD(xi = 0.4, sigma = 1), the
# shape of the illustrative order tail; 300 replications per sample
# size n = 50, 100, 200, 500, fixed seed. For each method: bias and
# root mean square error of xi, and the 5%, 50% and 95% points of the
# estimated 1-in-1000 excess level over its true value 37.122.
import math
import random
XI0 = 0.4
REPS = 300
TRUE_Q = ((0.001) ** (-XI0) - 1.0) / XI0
def gpd_draw(rng, n):
return [((1.0 - rng.random()) ** (-XI0) - 1.0) / XI0 for _ in range(n)]
def gpd_pwm(y):
ys = sorted(y)
n = len(ys)
a0 = math.fsum(ys) / n
a1 = math.fsum(v * (n - 1 - j) / (n - 1) for j, v in enumerate(ys)) / n
xi = 2.0 - a0 / (a0 - 2.0 * a1)
return xi, 2.0 * a0 * a1 / (a0 - 2.0 * a1)
def gpd_mom(y):
n = len(y)
m = math.fsum(y) / n
v = math.fsum((x - m) ** 2 for x in y) / (n - 1)
return 0.5 * (1.0 - m * m / v), 0.5 * m * (m * m / v + 1.0)
def profile(theta, y):
xi = math.fsum(math.log1p(theta * v) for v in y) / len(y)
return -len(y) * (math.log(xi / theta) + 1.0 + xi), xi, xi / theta
def gpd_mle(y):
m, top = math.fsum(y) / len(y), max(y)
lo, hi = -0.999 * m / top, 20.0
g = (math.sqrt(5.0) - 1.0) / 2.0
def f(t):
return profile(t / m, y)[0] if abs(t) > 1e-9 else -1e300
a, b = hi - g * (hi - lo), lo + g * (hi - lo)
fa, fb = f(a), f(b)
for _ in range(60):
if fa > fb:
hi, b, fb = b, a, fa
a = hi - g * (hi - lo)
fa = f(a)
else:
lo, a, fa = a, b, fb
b = lo + g * (hi - lo)
fb = f(b)
_, xi, sig = profile(0.5 * (lo + hi) / m, y)
return xi, sig
def pct(xs, p):
ys = sorted(xs)
return ys[min(len(ys) - 1, int(p * len(ys)))]
rng = random.Random(20261118)
meths = (("PWM", gpd_pwm), ("mom", gpd_mom), ("ML", gpd_mle))
print("true xi 0.4; 1-in-1000 excess level %.3f; %d reps" % (TRUE_Q, REPS))
print(" n | bias / rmse of xi: PWM mom ML")
qrows = []
for n in (50, 100, 200, 500):
xs_ = {k: [] for k, _ in meths}
qs_ = {k: [] for k, _ in meths}
for _ in range(REPS):
y = gpd_draw(rng, n)
for name, fit in meths:
xi, sig = fit(y)
xs_[name].append(xi)
qs_[name].append(sig / xi * ((0.001) ** (-xi) - 1.0) / TRUE_Q)
cells = []
for name, _ in meths:
e = [x - XI0 for x in xs_[name]]
bias = math.fsum(e) / REPS
rmse = math.sqrt(math.fsum(d * d for d in e) / REPS)
cells.append("%+.3f %.3f" % (bias, rmse))
print(" %4d |%s" % (n, "".join("%13s" % c for c in cells)))
qrows.append((n, [(pct(qs_[k], 0.05), pct(qs_[k], 0.5),
pct(qs_[k], 0.95)) for k, _ in meths]))
print("estimated / true 1-in-1000 level (5% 50% 95%)")
for n, cols in qrows:
print(" %4d " % n + " ".join("%.2f %.2f %.2f" % c for c in cols))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《极值理论广义帕累托尾部、超级鲸鱼客单上限与极端退单准备金母典》第 3 章「概率加权矩:只用标准库估计广义帕累托的两个参数」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-244 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026244,
author = {Fan, Yafu},
title = {Extreme-Value Theory and Generalised Pareto Tails: Whale-Order Ceilings and Reserves for Extreme Chargebacks},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}