关于「相位误差的价钱:报童模型下的订货时点」,《节气、热滞后与季节需求》给出的定量结论是什么?

结论:第六章用报童模型标价:照节气名字订货只拿到最优利润的 0.7196,比完全不考虑季节的平均订货(0.7530)还低,而气候变化造成的相位漂移只损失 0.00147。

数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化经营建议,订货日期只是演示,不对任何商家承诺销量。 第四章说明「哪天最热」是一个被天气噪声主导的统计量:示意数据中单日最高温的定位误差为 16.81 天,而三年逐日数据的谐波相位误差只有 1.25 天。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.7196, 0.7530

critical fractile 0.5714, z = 0.1800
assumed lagerrorseason profitshare of bestfill rate
0.0-32.541,6940.71960.7766
10.0-22.547,9230.82710.8351
20.0-12.553,9810.93170.8880
27.5-5.057,2180.98760.9152
32.5+0.057,9381.00000.9212
37.5+5.057,2200.98760.9150
44.0+11.554,5450.94140.8919
55.0+22.548,1310.83070.8344
no season at all (flat plan): 43,626, share 0.7530, fill 0.8042
查看完整验算程序
# Chapter 6. p61: what a phase error costs a weekly newsvendor
# ILLUSTRATIVE perishable seasonal line (same demand curve as p52:
# 30 + 12.0 E[max(0, T - 18)] units a day, true lag 32.5 days, 26
# weeks from d = -60 after Xiazhi). Weekly demand is normal with mean
# mu and sd 0.25 mu. Price 10, unit cost 6, salvage 3 (made-up), so
# the critical fractile is (10 - 6) / (10 - 3). Each week the buyer
# orders Q = m + z s where m is the forecast under an assumed lag l
# and s = 0.25 m (the newsvendor rule of Arrow, Harris and Marschak
# 1951, see also B-211). Expected sales mu - sigma L(z) with the
# normal loss L(z) = phi(z) - z (1 - Phi(z)); no stock carries over.
import math

YEAR = 365.2422
W = 2 * math.pi / YEAR
PRICE, COST, SALVAGE = 10.0, 6.0, 3.0
CV = 0.25
TRUE_LAG = 32.5


def phi(z):
    return math.exp(-0.5 * z * z) / math.sqrt(2 * math.pi)


def cdf(z):
    return 0.5 * (1 + math.erf(z / math.sqrt(2)))


def inv_cdf(p):
    lo, hi = -10.0, 10.0
    for _ in range(200):
        mid = (lo + hi) / 2
        if cdf(mid) < p:
            lo = mid
        else:
            hi = mid
    return (lo + hi) / 2


def pos_part(mu, s):
    return mu * cdf(mu / s) + s * phi(mu / s)


def weekly(lag, first=-60, weeks=26):
    out = []
    for w in range(weeks):
        days = []
        for i in range(7):
            d = first + 7 * w + i
            m = 14.0 + 14.0 * math.cos(W * (d - lag))
            days.append(30 + 12.0 * pos_part(m - 18, 3.0))
        out.append(math.fsum(days))
    return out


Z = inv_cdf((PRICE - COST) / (PRICE - SALVAGE))


def week_profit(q, mu):
    sigma = CV * mu
    z = (q - mu) / sigma
    sold = mu - sigma * (phi(z) - z * (1 - cdf(z)))
    return PRICE * sold + SALVAGE * (q - sold) - COST * q, sold


def season(plan, truth):
    prof, sold = [], []
    for m, mu in zip(plan, truth):
        p, s = week_profit(m * (1 + Z * CV), mu)
        prof.append(p)
        sold.append(s)
    return math.fsum(prof), math.fsum(sold)


if __name__ == "__main__":
    truth = weekly(TRUE_LAG)
    demand = math.fsum(truth)
    best, _ = season(truth, truth)
    print("critical fractile {:.4f}, z = {:.4f}".format(
        (PRICE - COST) / (PRICE - SALVAGE), Z))
    print("assumed lag  error  season profit  share of best  fill rate")
    for lag in (0.0, 10.0, 20.0, 27.5, 32.5, 37.5, 44.0, 55.0):
        p, s = season(weekly(lag), truth)
        print("{:11.1f}  {:+5.1f}  {:13,.0f}  {:13.4f}  {:9.4f}".format(
            lag, lag - TRUE_LAG, p, p / best, s / demand))
    flat, s = season([demand / 26] * 26, truth)
    print("no season at all (flat plan): {:,.0f}, share {:.4f}, fill {:.4f}"
          .format(flat, flat / best, s / demand))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《二十四节气气温滞后相位、三伏一阶热惯性与季节性消费需求预测母典》第 6 章「相位误差的价钱:报童模型下的订货时点」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-232 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026232,
  author    = {Fan, Yafu},
  title     = {Temperature Phase Lag across the Twenty-Four Solar Terms, First-Order Thermal Inertia behind the Dog Days and Seasonal Demand Forecasting},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论