关于「平均超额图与阈值选择:偏差、方差与对数正态陷阱」,《极值尾部与退单准备金》给出的定量结论是什么?
结论:第五章用平均超额图与 150 家模拟店铺选阈值,第九十百分位上十年一遇水平的对数误差最小,为 0.194。
数据口径:书中的订单、退单、请求量与参数均为示意;全部计算由书中程序生成;准备金与服务器冗余的讨论属于非个人化经营与财务方法,不构成理财、会计、税务或投资建议,实际金额与生产变更须由经营者人工决定。 第一章显示,在形状约 0.4 的示意订单尾部上,真实千分之一分位是正态估计的 2.57 倍,万分之一分位是 5.56 倍;样本上的正态估计中位数只有真实值的 0.363,最大的 20 笔订单占去离差平方和的 0.353。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.194, 150
| exact 120-month level 27214 yuan; 150 shops x 43200 orders | |||||
| q | xi med | xi 5%-95% | sigma* | level ratio | rms log |
| 0.80 | 0.362 | 0.329-0.389 | 56.0 | 0.830 | 0.241 |
| 0.90 | 0.383 | 0.334-0.419 | 39.2 | 0.931 | 0.194 |
| 0.95 | 0.387 | 0.330-0.447 | 33.5 | 0.955 | 0.217 |
| 0.98 | 0.389 | 0.309-0.481 | 24.0 | 0.965 | 0.270 |
| 0.99 | 0.391 | 0.283-0.516 | 23.7 | 0.938 | 0.308 |
查看完整验算程序
# Chapter 5. p52: where to put the threshold - bias against variance.
# Model: 150 simulated shops, each with 24 months of 1,800 orders from
# the illustrative Burr XII law (b = 200, c = 2, k = 1.25), fixed seed.
# For thresholds at the empirical 0.80 to 0.99 quantiles we fit a GPD
# by PWM, then report: the median and 90% range of xi, the modified
# scale sigma* = sigma - xi u (flat when the GPD holds), and the error
# of the 120-month return level against its exact value, as a median
# ratio and a root mean square of the log ratio.
import math
import random
B, C, K = 200.0, 2.0, 1.25
PER, MONTHS, REPS = 1800, 24, 150
def burr_q(p):
return B * ((1.0 - p) ** (-1.0 / K) - 1.0) ** (1.0 / C)
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 pct(xs, p):
ys = sorted(xs)
return ys[min(len(ys) - 1, int(p * len(ys)))]
QS = (0.80, 0.90, 0.95, 0.98, 0.99)
exact = burr_q(1.0 - 1.0 / (PER * 120))
rng = random.Random(20261122)
xi_s = {q: [] for q in QS}
ss_s = {q: [] for q in QS}
lr_s = {q: [] for q in QS}
for _ in range(REPS):
xs = sorted(burr_q(rng.random()) for _ in range(PER * MONTHS))
n = len(xs)
for q in QS:
u = xs[int(q * n)]
y = [x - u for x in xs if x > u]
xi, sig = gpd_pwm(y)
lev = u + sig / xi * ((len(y) / MONTHS * 120) ** xi - 1.0)
xi_s[q].append(xi)
ss_s[q].append(sig - xi * u)
lr_s[q].append(math.log(lev / exact))
print("exact 120-month level %.0f yuan; %d shops x %d orders"
% (exact, REPS, PER * MONTHS))
print(" q xi med xi 5%-95% sigma* level ratio rms log")
for q in QS:
lr = lr_s[q]
rms = math.sqrt(math.fsum(v * v for v in lr) / REPS)
print(" %4.2f %6.3f %5.3f-%5.3f %8.1f %10.3f %7.3f"
% (q, pct(xi_s[q], 0.5), pct(xi_s[q], 0.05), pct(xi_s[q], 0.95),
pct(ss_s[q], 0.5), math.exp(pct(lr, 0.5)), rms))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《极值理论广义帕累托尾部、超级鲸鱼客单上限与极端退单准备金母典》第 5 章「平均超额图与阈值选择:偏差、方差与对数正态陷阱」(版本 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}
}