关于「随机化回答与本地模型:把噪声交给顾客自己加」,《差分隐私与经营统计发布》给出的定量结论是什么?
结论:第五章讨论随机化回答与本地模型,同一 ε 下本地模型的误差是中心模型的 24.6 倍。
数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化的法律与经营建议,差分隐私是数学保证,不替代法律合规,法规只述大意,以上架前人工复核为准。 第三章处理敏感度:营收按人截断,示意数据中均方根误差 6545 元,占营收 4.09 %;客群分布按并行组合只花一次预算。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 24.6
| age histogram of 387 customers: sd of each released count | |
| eps central sd local 25-34 local 65+ ratio | |
| 0.5 | 2.83 77.91 72.33 27.5 |
| 1.0 | 1.41 34.80 29.91 24.6 |
| 2.0 | 0.71 14.03 10.57 19.8 |
| 4.0 | 0.35 4.30 2.89 12.2 |
| check at eps 1, band 65+: mean 5.88 (true 6), sd 29.61 | |
| sd of the 25-34 share at eps 1, central versus local: | |
| n | 387 central 0.003654 local 0.089927 |
| n | 10000 central 0.000141 local 0.017691 |
| n | 1000000 central 0.000001 local 0.001769 |
查看完整验算程序
# Chapter 5. p52: local versus central noise for a customer histogram.
# Local: every customer randomizes her own age band with k-ary randomized
# response (keep with p = e**eps / (e**eps + k - 1), else one of the other
# k - 1 bands, each with q = 1 / (e**eps + k - 1)); the shop debiases
# counts by (c_j - n q) / (p - q). Central: the shop holds true counts
# and adds Laplace(1 / eps) to each bin. Same eps per customer in both.
# Bands and counts as in p32 (illustrative); 4000 fixed-seed releases.
import math
import random
TRUE = [37, 142, 118, 61, 23, 6]
K = len(TRUE)
rng = random.Random(20261113)
def local_sd(n, f, eps):
p = math.exp(eps) / (math.exp(eps) + K - 1)
q = 1.0 / (math.exp(eps) + K - 1)
var = n * (q * (1 - q) + f * (1 - p - q) * (p - q)) / (p - q) ** 2
return math.sqrt(var)
n = int(math.fsum(TRUE))
people = [j for j, c in enumerate(TRUE) for _ in range(c)]
print("age histogram of %d customers: sd of each released count" % n)
print("%5s %12s %12s %12s %8s" % (
"eps", "central sd", "local 25-34", "local 65+", "ratio"))
for eps in (0.5, 1.0, 2.0, 4.0):
central = math.sqrt(2.0) / eps
l1 = local_sd(n, TRUE[1] / n, eps)
l5 = local_sd(n, TRUE[5] / n, eps)
print("%5.1f %12.2f %12.2f %12.2f %8.1f" % (
eps, central, l1, l5, l1 / central))
eps = 1.0
p = math.exp(eps) / (math.exp(eps) + K - 1)
q = 1.0 / (math.exp(eps) + K - 1)
ests = []
for _ in range(4000):
c = [0] * K
for j in people:
if rng.random() < p:
c[j] += 1
else:
o = rng.randrange(K - 1)
c[o if o < j else o + 1] += 1
ests.append((c[5] - n * q) / (p - q))
m = math.fsum(ests) / len(ests)
sd = math.sqrt(math.fsum((e - m) ** 2 for e in ests) / (len(ests) - 1))
print("check at eps 1, band 65+: mean %.2f (true 6), sd %.2f" % (m, sd))
print("sd of the 25-34 share at eps 1, central versus local:")
for size in (387, 10000, 1000000):
f = TRUE[1] / n
print(" n %8d central %.6f local %.6f" % (
size, math.sqrt(2.0) / size, local_sd(size, f, 1.0) / size))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《差分隐私拉普拉斯机制与隐私预算会计、公开经营统计而不泄露个人的发布母典》第 5 章「随机化回答与本地模型:把噪声交给顾客自己加」(版本 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}
}