关于「敏感度:营收先截断,客群分布只花一次预算」,《差分隐私与经营统计发布》给出的定量结论是什么?
结论:第三章处理敏感度:营收按人截断,示意数据中均方根误差 6545 元,占营收 4.09 %;客群分布按并行组合只花一次预算。
数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化的法律与经营建议,差分隐私是数学保证,不替代法律合规,法规只述大意,以上架前人工复核为准。 第三章处理敏感度:营收按人截断,示意数据中均方根误差 6545 元,占营收 4.09 %;客群分布按并行组合只花一次预算。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 4.09, 6545
| true monthly revenue 159869 yuan from 400 customers, eps = 0.5 | |||||
| C | clipped | bias | noise sd | RMSE | RMSE % |
| 250 | 0.560 | 78971 | 707 | 78974 | 49.40 |
| 500 | 0.242 | 41775 | 1414 | 41799 | 26.15 |
| 750 | 0.110 | 25652 | 2121 | 25739 | 16.10 |
| 1000 | 0.068 | 16845 | 2828 | 17080 | 10.68 |
| 1500 | 0.030 | 7505 | 4243 | 8621 | 5.39 |
| 2000 | 0.013 | 3292 | 5657 | 6545 | 4.09 |
| 3000 | 0.005 | 970 | 8485 | 8541 | 5.34 |
| 5000 | 0.000 | 0 | 14142 | 14142 | 8.85 |
| 10000 | 0.000 | 0 | 28284 | 28284 | 17.69 |
| best of the grid: C = 2000, RMSE 6545 yuan | |||||
| spend quantiles: p50 278 | p90 789 | p99 2086 | max 3623 | ||
| if one customer may add up to 6 orders, order-level clipping | |||||
| at C = 2000 needs noise sd 33941, not 5657 |
查看完整验算程序
# Chapter 3. p31: choosing the clipping bound C for a revenue total.
# One customer can change an unclipped revenue sum by any amount, so its
# sensitivity is unbounded. Clip each customer's monthly spend at C: the
# sensitivity becomes C, the noise sd is sqrt(2) * C / eps, and the price
# is a bias, the spend above C that is cut away. Root mean square error
# = sqrt(bias**2 + 2 * C**2 / eps**2). 400 customers with log-normal
# spend (median 300 yuan, sigma 0.9; illustrative), eps = 0.5.
import math
import random
rng = random.Random(20261113)
spend = [math.exp(rng.gauss(math.log(300.0), 0.9)) for _ in range(400)]
total = math.fsum(spend)
EPS = 0.5
print("true monthly revenue %.0f yuan from %d customers, eps = %.1f"
% (total, len(spend), EPS))
print("%6s %8s %10s %10s %10s %8s"
% ("C", "clipped", "bias", "noise sd", "RMSE", "RMSE %"))
best = None
for c in (250, 500, 750, 1000, 1500, 2000, 3000, 5000, 10000):
cut = math.fsum(max(0.0, x - c) for x in spend)
share = len([x for x in spend if x > c]) / len(spend)
sd = math.sqrt(2.0) * c / EPS
rmse = math.sqrt(cut * cut + sd * sd)
if best is None or rmse < best[1]:
best = (c, rmse)
print("%6d %8.3f %10.0f %10.0f %10.0f %8.2f"
% (c, share, cut, sd, rmse, 100.0 * rmse / total))
print("best of the grid: C = %d, RMSE %.0f yuan" % best)
q = sorted(spend)
print("spend quantiles: p50 %.0f p90 %.0f p99 %.0f max %.0f"
% (q[199], q[359], q[395], q[-1]))
# a customer with k orders counted as k rows has sensitivity k * C
print("if one customer may add up to 6 orders, order-level clipping")
print("at C = %d needs noise sd %.0f, not %.0f"
% (best[0], 6 * math.sqrt(2.0) * best[0] / EPS,
math.sqrt(2.0) * best[0] / EPS))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《差分隐私拉普拉斯机制与隐私预算会计、公开经营统计而不泄露个人的发布母典》第 3 章「敏感度:营收先截断,客群分布只花一次预算」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-296 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026296,
author = {Fan, Yafu},
title = {Differential Privacy, the Laplace Mechanism and Privacy-Budget Accounting: Publishing Business Statistics without Exposing Any Individual},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}