关于「退单准备金与服务器冗余:把回报水平写进账本与机房」,《极值尾部与退单准备金》给出的定量结论是什么?
结论:第六章把回报水平写进退单准备金与服务器冗余:月度账单在千个月一遇时真实值是正态规则的 1.77 倍,按形状上端拼接拟合的准备金为 9798 元;去节律后的残差方法使服务器一年过载分钟数的中位数为 0.98。
数据口径:书中的订单、退单、请求量与参数均为示意;全部计算由书中程序生成;准备金与服务器冗余的讨论属于非个人化经营与财务方法,不构成理财、会计、税务或投资建议,实际金额与生产变更须由经营者人工决定。 第一章显示,在形状约 0.4 的示意订单尾部上,真实千分之一分位是正态估计的 2.57 倍,万分之一分位是 5.56 倍;样本上的正态估计中位数只有真实值的 0.363,最大的 20 笔订单占去离差平方和的 0.353。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 1.77
| monthly chargeback bill: mean 1833, sd 1098 yuan (lam 7.2) | |
| level | 1-in-T mo simulated normal ratio |
| 0.950 | 20 3624 3639 1.00 |
| 0.990 | 100 5080 4387 1.16 |
| 0.995 | 200 5962 4661 1.28 |
| 0.999 | 1000 9257 5226 1.77 |
| expected shortfall beyond 0.99 | 7305 yuan |
| three average months | 5500; months above it: 0.0070 |
| months above q0.99 where one chargeback is over half the bill | 0.607 |
查看完整验算程序
# Chapter 6. p61: the monthly chargeback bill and three reserve rules.
# Model: 1,800 orders a month, each charged back with probability 0.004
# (Poisson count, mean 7.2 a month); a chargeback costs the order value
# (illustrative Burr XII law, b = 200, c = 2, k = 1.25) plus a 15 yuan
# fee. All parameters are illustrative. 40,000 simulated months (fixed
# seed) give the exact-by-simulation quantiles and expected shortfall;
# set beside them the normal rule mean + z sd from the exact compound
# Poisson moments, and the rule of thumb "three average months".
import math
import random
from statistics import NormalDist
B, C, K = 200.0, 2.0, 1.25
PER, RATE, FEE = 1800, 0.004, 15.0
LAM = PER * RATE
MONTHS = 40000
ND = NormalDist()
def burr_q(p):
return B * ((1.0 - p) ** (-1.0 / K) - 1.0) ** (1.0 / C)
def beta(a, b):
return math.exp(math.lgamma(a) + math.lgamma(b) - math.lgamma(a + b))
def poisson(rng, lam):
lim, k, p = math.exp(-lam), 0, rng.random()
while p > lim:
k += 1
p *= rng.random()
return k
def pct(xs, p):
ys = sorted(xs)
return ys[min(len(ys) - 1, int(p * len(ys)))]
m1 = B * K * beta(K - 1.0 / C, 1.0 + 1.0 / C)
m2 = B * B * K * beta(K - 2.0 / C, 1.0 + 2.0 / C)
mean_l = LAM * (m1 + FEE)
sd_l = math.sqrt(LAM * (m2 + 2.0 * FEE * m1 + FEE * FEE))
rng = random.Random(20261124)
pairs = []
for _ in range(MONTHS):
k = poisson(rng, LAM)
xs = [burr_q(rng.random()) + FEE for _ in range(k)]
pairs.append((math.fsum(xs), max(xs) if xs else 0.0))
loss = sorted(t for t, _ in pairs)
print("monthly chargeback bill: mean %.0f, sd %.0f yuan (lam %.1f)"
% (mean_l, sd_l, LAM))
print(" level 1-in-T mo simulated normal ratio")
for p in (0.95, 0.99, 0.995, 0.999):
sim = pct(loss, p)
nor = mean_l + sd_l * ND.inv_cdf(p)
print(" %5.3f %8.0f %9.0f %7.0f %6.2f"
% (p, 1.0 / (1.0 - p), sim, nor, sim / nor))
tail = loss[int(0.99 * MONTHS):]
print(" expected shortfall beyond 0.99: %.0f yuan" % (math.fsum(tail)
/ len(tail)))
rot = 3.0 * mean_l
print(" three average months = %.0f; months above it: %.4f"
% (rot, len([x for x in loss if x > rot]) / MONTHS))
q99 = pct(loss, 0.99)
bad = [(t, m) for t, m in pairs if t > q99]
one = len([1 for t, m in bad if m > 0.5 * t])
print(" months above q0.99 where one chargeback is over half the bill:"
" %.3f" % (one / len(bad)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《极值理论广义帕累托尾部、超级鲸鱼客单上限与极端退单准备金母典》第 6 章「退单准备金与服务器冗余:把回报水平写进账本与机房」(版本 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}
}