What does Maximum-Entropy Demand Reconstruction conclude, in numbers, about “Stocking a New Product with the Newsvendor Model: Ordering at a Maximum-Entropy Quantile and Worst-Case Regret”?
Answer: Chapter 6 puts the maximum-entropy quantile into the newsvendor model for new products; for thin-margin lines the normal shortcut's worst regret share reaches 1.018.
Scope of the numbers: The normal shortcut adds a symmetric shape and a standard deviation; under illustrative parameters, with a mean of 80 and a floor of 30, it puts 0.133 of its probability on impossible values, rising to 0.412 when the mean is 40. Accepting only the bounds and the mean, the maximum-entropy principle proposed by Jaynes in 1957 gives a truncated exponential distribution, with a 90th-percentile order of 146.0 for the illustrative dessert shop.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 1.018
| cost ratio | worst regret share: max-ent normal uniform | ||||
| 14 | 0.882 | | 0.066 | 0.136 | 0.223 |
| 20 | 0.765 | | 0.008 | 0.010 | 0.509 |
| 25 | 0.667 | | 0.140 | 0.184 | 0.834 |
| 33 | 0.510 | | 0.253 | 0.633 | 2.294 |
| 41 | 0.353 | | 0.124 | 1.018 | 4.003 |
| 47 | 0.235 | | 0.241 | 0.855 | 4.808 |
Show the full program
# Chapter 6. p62: worst-case regret across margins.
# Model: the newsvendor of p61 (demand in [0, 600], mean 150, price 59,
# clearance value 8, illustrative) with the unit cost varied, which
# moves the critical ratio. For each ratio and each assumed shape we
# take the regret under each of the four true shapes of p61 as a share
# of the best profit attainable under that truth, and report the
# largest share. Integrals by Simpson rule with math.fsum.
import math
from statistics import NormalDist
A, B, M = 0.0, 600.0, 150.0
L = B - A
FR = (M - A) / L
F2 = (FR - 0.75 * 0.1) / 0.25
MIX = ((0.75, 4.0, 36.0), (0.25, 8.0, 8.0 * (1 - F2) / F2))
def simpson(f, lo, hi, n=2000):
h = (hi - lo) / n
terms = [f(lo), f(hi)]
terms += [4.0 * f(lo + i * h) for i in range(1, n, 2)]
terms += [2.0 * f(lo + i * h) for i in range(2, n, 2)]
return math.fsum(terms) * h / 3.0
def integ(f, n=2000, hi=B):
# x = A + v * v removes the kink of densities that start at A
g = lambda v: f(A + v * v) * 2.0 * v
return simpson(g, 0.0, math.sqrt(hi - A), n)
def te_mean(lam):
u = lam * L
if abs(u) < 1e-8:
return A + L / 2.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
return (lo + hi) / 2.0
def te_pdf(lam):
return lambda x: lam * math.exp(-lam * (x - A)) / -math.expm1(-lam * L)
def te_q(lam, p):
return A - math.log1p(p * math.expm1(-lam * L)) / lam
def beta_pdf(u, al, be):
if u <= 0.0 or u >= 1.0:
return 0.0
lg = math.lgamma(al + be) - math.lgamma(al) - math.lgamma(be)
return math.exp(lg + (al - 1) * math.log(u) + (be - 1) * math.log1p(-u))
def beta_x(al, be):
return lambda x: beta_pdf((x - A) / L, al, be) / L
def mix_pdf(x):
return math.fsum(w * beta_x(a, b)(x) for w, a, b in MIX)
def truths():
lam = solve(M)
return [("max-ent", te_pdf(lam)),
("b(2,6)", beta_x(2.0, 6.0)),
("b(1.2,3.6)", beta_x(1.2, 3.6)),
("hit-or-flop", mix_pdf)]
def quantile(f, p):
lo, hi = A, B
for _ in range(40):
mid = (lo + hi) / 2.0
if integ(f, 400, mid) < p:
lo = mid
else:
hi = mid
return (lo + hi) / 2.0
def profit(f, q, price, cost, salvage):
# expected profit of ordering q units when demand has density f
sold = integ(lambda x: x * f(x), 800, q) + q * (1.0 - integ(f, 800, q))
return (price - salvage) * sold - (cost - salvage) * q
if __name__ == "__main__":
price, salv = 59.0, 8.0
lam = solve(M)
nd = NormalDist(M, L / 6.0)
ts = truths()
print(" cost ratio | worst regret share: max-ent normal uniform")
for cost in (14.0, 20.0, 25.0, 33.0, 41.0, 47.0):
cr = (price - cost) / (price - salv)
best = [quantile(t, cr) for _, t in ts]
bestp = [profit(t, q, price, cost, salv)
for (_, t), q in zip(ts, best)]
out = []
for q in (te_q(lam, cr), max(0.0, nd.inv_cdf(cr)), A + cr * L):
shares = [(bp - profit(t, q, price, cost, salv)) / bp
for bp, (_, t) in zip(bestp, ts)]
out.append(max(shares))
print(" {:>4.0f} {:>5.3f} | {:>29.3f} {:>6.3f} {:>7.3f}".format(
cost, cr, *out))Single source and citation
Fan, Y. (2026). The Maximum-Entropy Principle and Demand Reconstruction from Missing Data: the Least-Biased Order-Value Distribution Given Only a Mean and Bounds (Version 1.0.0), Chapter 6: Stocking a New Product with the Newsvendor Model: Ordering at a Maximum-Entropy Quantile and Worst-Case Regret. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 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}
}Other chapter answers in this book
- Chapter 1 · The Lagrange Multiplier of Maximum Entropy: the Truncated Exponential When Only a Mean and Bounds Are Known
- Chapter 2 · Discrete Maximum Entropy over Price Tiers: Wallis's Count, the Concentration Theorem and the Limits of Uniqueness
- Chapter 3 · The Cost of the Normal and Uniform Shortcuts: Quantiles, Log Loss and the Minimax
- Chapter 4 · Adding the Second Moment: the Truncated Normal Family, Convex Exponents and What One Standard Deviation Buys
- Chapter 5 · After the Sample Arrives: Plug-in Bias, the Second-Moment Trap and the Handover Point
- Chapter 7 · East and West in the Classics: "Knowing That One Does Not Know" in Laozi 71 and Laplace's Philosophical Essay on Probabilities
- Chapter 8 · Closing the Loop: Cold-Start Demand for a New Product, the Maximum-Entropy Demand Reconstructor and a Pre-Registered Plan of Refutation