关于「离散最大熵与价格档位:沃利斯计数、集中定理与「唯一」的边界」,《最大熵需求重建》给出的定量结论是什么?
结论:均价从 79 改成 85,149 元及以上的份额从 0.1770 涨到 0.2100;改成 73,降到 0.1438。均价只差六元,大单份额就差出三到四个百分点,这说明最大熵答案对均值的准确度相当敏感,第五章会专门讨论均值本身来自小样本时的偏差。增加一个 399 元的档位,即使均价不变,149 元及以上的份额也从 0.1770 变成 0.1695,最低档从 0.2672 变成 0.2752;删去 299 元档,大单份额变成 0.1931。支撑是约束的一部分:菜单上有哪些价位,本身就是一条信息。
数据口径:本书推翻这一常识:正态捷径私加了对称形状与标准差,示意参数下均值 80、下限 30 时它把 0.133 的概率放在不可能的区间,均值 40 时升到 0.412;均匀捷径隐含均值在区间中点,直接违背已知均值。 只承认上下限与均值时,杰恩斯 1957 年提出的最大熵原则给出截断指数分布,示意甜品店的第 90 百分位客单为 146.0 元。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.1438, 0.1695, 0.1770, 0.1931, 0.2100, 0.2672
| case | P(29) | P(>=149) mean | H bits | |
| mean 79, seven tiers | 0.2672 | 0.1770 | 79.00 | 2.540 |
| mean 85, seven tiers | 0.2455 | 0.2100 | 85.00 | 2.610 |
| mean 73, seven tiers | 0.2923 | 0.1438 | 73.00 | 2.456 |
| mean 79, add a 399 tier | 0.2752 | 0.1695 | 79.00 | 2.553 |
| mean 79, drop the 299 tier | 0.2460 | 0.1931 | 79.00 | 2.495 |
| geometric mean 65 | 0.2994 | 0.2169 | 85.69 | 2.595 |
| geometric mean implied by the mean-79 answer: 63.34 | ||||
| geometric mean set to that | 0.3117 | 0.2049 | 83.29 | 2.566 |
查看完整验算程序
# Chapter 2. p23: change the constraints and the "unique" answer changes.
# Model: the seven price tiers of p21 with an average of 79 (all
# illustrative). We re-solve the discrete maximum-entropy problem after
# changing one input at a time: the stated mean, the list of tiers, and
# the kind of average (arithmetic mean of price versus mean of log
# price, which turns exp(-lam x) into the power law x^(-lam)). The
# answer is unique only relative to the support and constraints chosen.
import math
BASE = [29.0, 49.0, 69.0, 99.0, 149.0, 199.0, 299.0]
def shares(xs, lam, feat):
f = [feat(x) for x in xs]
w = [math.exp(-lam * (v - f[0])) for v in f]
z = math.fsum(w)
return [v / z for v in w]
def solve(xs, target, feat):
lo, hi = -5.0, 5.0
for _ in range(120):
mid = (lo + hi) / 2.0
p = shares(xs, mid, feat)
m = math.fsum(a * feat(x) for a, x in zip(p, xs))
if m > target:
lo = mid
else:
hi = mid
return shares(xs, (lo + hi) / 2.0, feat)
def report(name, xs, p):
hi = math.fsum(a for a, x in zip(p, xs) if x >= 149.0)
mean = math.fsum(a * x for a, x in zip(p, xs))
h = -math.fsum(a * math.log2(a) for a in p if a > 0.0)
print(" {:<30} {:>6.4f} {:>6.4f} {:>6.2f} {:>5.3f}".format(
name, p[0], hi, mean, h))
if __name__ == "__main__":
ident = lambda x: x
print(" case P(29) P(>=149) mean H bits")
report("mean 79, seven tiers", BASE, solve(BASE, 79.0, ident))
report("mean 85, seven tiers", BASE, solve(BASE, 85.0, ident))
report("mean 73, seven tiers", BASE, solve(BASE, 73.0, ident))
more = BASE + [399.0]
report("mean 79, add a 399 tier", more, solve(more, 79.0, ident))
less = BASE[:-1]
report("mean 79, drop the 299 tier", less, solve(less, 79.0, ident))
p = solve(BASE, math.log(65.0), math.log)
report("geometric mean 65", BASE, p)
gm = math.exp(math.fsum(a * math.log(x)
for a, x in zip(solve(BASE, 79.0, ident), BASE)))
print("geometric mean implied by the mean-79 answer: {:.2f}".format(gm))
p = solve(BASE, math.log(gm), math.log)
report("geometric mean set to that", BASE, p)唯一数据源与引用
范雅福(Fan, Y.). (2026). 《最大熵原理与缺数据需求重建、仅知均价与上下限时最不偏的客单分布推断母典》第 2 章「离散最大熵与价格档位:沃利斯计数、集中定理与「唯一」的边界」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-301 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026301,
author = {Fan, Yafu},
title = {The Maximum-Entropy Principle and Demand Reconstruction from Missing Data: the Least-Biased Order-Value Distribution Given Only a Mean and Bounds},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}