关于「最大熵的拉格朗日乘子:只知均价与上下限时的截断指数分布」,《最大熵需求重建》给出的定量结论是什么?
结论:均值越靠近下限,正态捷径越离谱。均值为 40 时,正态分布把 0.412 的概率放在 30 元以下,第 10 百分位是负数 \(-17.7\) 元,这在任何店里都不可能;均值为 50 时这一份额是 0.328,均值为 80 时仍有 0.133。与此同时,两种方法对第 90 百分位的判断差距在均值 40 时为 \(-44.6\) 元(正态高估),在均值 130 时为 55.6 元(正态低估),中间某处差距穿过零。均值 80 处差距只有 8.4 元,这说明在某些点上正态捷径的上尾数字碰巧不坏,第三章会专门处理这一点:它不坏,是因为两种错误相互抵消,而不是因为它更有根据。
数据口径:本书推翻这一常识:正态捷径私加了对称形状与标准差,示意参数下均值 80、下限 30 时它把 0.133 的概率放在不可能的区间,均值 40 时升到 0.412;均匀捷径隐含均值在区间中点,直接违背已知均值。 只承认上下限与均值时,杰恩斯 1957 年提出的最大熵原则给出截断指数分布,示意甜品店的第 90 百分位客单为 146.0 元。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: -17.7, -44.6, 0.133, 0.328, 0.412, 10
| bounds [30, 300]; shortcut = normal(m, 45) | ||||||||
| m | (m-a)/(b-a) | ME P10 | ME P90 | N P10 | N P90 | N<a | N>b | P90 gap |
| 40 | 0.037 | 31.1 | 53.0 | -17.7 | 97.7 | 0.412 | 0.000 | -44.6 |
| 50 | 0.074 | 32.1 | 76.1 | -7.7 | 107.7 | 0.328 | 0.000 | -31.6 |
| 65 | 0.130 | 33.7 | 110.7 | 7.3 | 122.7 | 0.218 | 0.000 | -11.9 |
| 80 | 0.185 | 35.4 | 146.0 | 22.3 | 137.7 | 0.133 | 0.000 | 8.4 |
| 100 | 0.259 | 38.1 | 191.8 | 42.3 | 157.7 | 0.060 | 0.000 | 34.1 |
| 130 | 0.370 | 43.9 | 243.2 | 72.3 | 187.7 | 0.013 | 0.000 | 55.6 |
| 165 | 0.500 | 57.0 | 273.0 | 107.3 | 222.7 | 0.001 | 0.001 | 50.3 |
查看完整验算程序
# Chapter 1. p13: how far the normal shortcut strays as the mean moves.
# Model: bounds a = 30, b = 300 (illustrative order values). For each
# stated mean m we compare the maximum-entropy answer (truncated
# exponential, lam found by bisection) with the common shortcut
# normal(m, (b - a) / 6). We report P10 and P90 of both, the share of
# the normal that falls below a or above b (values the owner said are
# impossible), and the gap between the two P90s.
import math
from statistics import NormalDist
A, B = 30.0, 300.0
L = B - A
def te_mean(lam):
u = lam * L
if abs(u) < 1e-8:
return A + L / 2.0 - lam * L * L / 12.0
return A + 1.0 / lam - L / math.expm1(u)
def solve(m):
lo, hi = -2.0, 2.0
for _ in range(80):
mid = (lo + hi) / 2.0
if te_mean(mid) > m:
lo = mid
else:
hi = mid
lam = (lo + hi) / 2.0
return 0.0 if abs(lam) < 1e-9 else lam
def te_q(lam, p):
if abs(lam * L) < 1e-12:
return A + p * L
return A - math.log1p(p * math.expm1(-lam * L)) / lam
if __name__ == "__main__":
sd = L / 6.0
print("bounds [30, 300]; shortcut = normal(m, {:.0f})".format(sd))
print(" m (m-a)/(b-a) ME P10 ME P90 N P10 N P90"
" N<a N>b P90 gap")
for m in (40.0, 50.0, 65.0, 80.0, 100.0, 130.0, 165.0):
lam = solve(m)
nd = NormalDist(m, sd)
e10, e90 = te_q(lam, 0.1), te_q(lam, 0.9)
n10, n90 = nd.inv_cdf(0.1), nd.inv_cdf(0.9)
lo, hi = nd.cdf(A), 1.0 - nd.cdf(B)
print(" {:>3.0f} {:>11.3f} {:>6.1f} {:>6.1f} {:>5.1f} {:>5.1f}"
" {:.3f} {:.3f} {:>7.1f}".format(
m, (m - A) / L, e10, e90, n10, n90, lo, hi, e90 - n90))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《最大熵原理与缺数据需求重建、仅知均价与上下限时最不偏的客单分布推断母典》第 1 章「最大熵的拉格朗日乘子:只知均价与上下限时的截断指数分布」(版本 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}
}