关于「需求的相位:气温与需求的回归,以及名义季节的错位」,《节气、热滞后与季节需求》给出的定量结论是什么?

结论:第五章把需求接到气温上:照节气名字订货,计划在第 10 周累计过半,真实需求要到第 14 周,正好早一个月;只有由日照驱动的品类没有这个滞后。

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

English version

对照数据表

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

season demand (units)17,488; truth reaches half in week 14
plan lag MAPE half-wk lost % left % mean stock peak
0.00.531 10 2.65 0.00 2.31 4.30
15.00.298 12 0.47 0.00 1.39 2.18
32.50.000 14 0.00 0.00 0.00 0.00
44.00.193 15 7.84 7.50 0.74 5.52
d0.00: plan(l=0) / truth = 1.205
d15.70: plan(l=0) / truth = 1.006
d31.45: plan(l=0) / truth = 0.840
d47.14: plan(l=0) / truth = 0.678
查看完整验算程序
# Chapter 5. p52: ordering by the names of the terms versus the lag
# ILLUSTRATIVE strongly seasonal category (iced drinks sold by the
# case, made-up numbers). Expected daily units
# 30 + 12.0 E[max(0, T - 18)], T normal with sd 3.0 C around the
# seasonal mean 14.0 + 14.0 cos(w (d - L)), d = days after Xiazhi,
# true lag L = 32.5 days. E[max(0, X)] for X normal(mu, s) is
# mu Phi(mu / s) + s phi(mu / s). The season runs 26 weeks from
# d = -60. A plan assumes lag l: l = 0 is "the terms as named"
# (midsummer at Xiazhi). Each week the plan delivers its forecast;
# unsold units carry over, unmet demand is lost. Stock is counted in
# weeks of that week's true demand. All sums by fsum.
import math

YEAR = 365.2422
W = 2 * math.pi / YEAR
TRUE_LAG = 32.5
SD_T = 3.0


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 pos_part(mu, s):
    return mu * cdf(mu / s) + s * phi(mu / s)


def daily(d, lag):
    m = 14.0 + 14.0 * math.cos(W * (d - lag))
    return 30 + 12.0 * pos_part(m - 18, SD_T)


def weekly(lag, first=-60, weeks=26):
    return [math.fsum(daily(first + 7 * w + i, lag) for i in range(7))
            for w in range(weeks)]


def half_week(series):
    total = math.fsum(series)
    for k in range(len(series)):
        if math.fsum(series[:k + 1]) >= total / 2:
            return k
    return len(series) - 1


if __name__ == "__main__":
    truth = weekly(TRUE_LAG)
    total = math.fsum(truth)
    print("season demand (units): {:,.0f}; truth reaches half in week {}"
          .format(total, half_week(truth) + 1))
    print("plan lag  MAPE   half-wk  lost %  left %  mean stock  peak")
    for lag in (0.0, 15.0, 32.5, 44.0):
        plan = weekly(lag)
        mape = math.fsum(abs(p - t) / t for p, t in zip(plan, truth))
        mape /= len(truth)
        stock, lost, peak, held = 0.0, [], 0.0, []
        for p, t in zip(plan, truth):
            stock = stock + p
            sold = min(stock, t)
            lost.append(t - sold)
            stock = stock - sold
            held.append(stock / t)
            peak = max(peak, stock / t)
        print("{:8.1f}  {:5.3f}  {:7d}  {:6.2f}  {:6.2f}  {:10.2f}  {:4.2f}"
              .format(lag, mape, half_week(plan) + 1,
                      100 * math.fsum(lost) / total, 100 * stock / total,
                      math.fsum(held) / len(held), peak))
    for d in (0, 15.7, 31.45, 47.14):
        print("d = {:5.2f}: plan(l=0) / truth = {:.3f}".format(
            d, daily(d, 0.0) / daily(d, TRUE_LAG)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《二十四节气气温滞后相位、三伏一阶热惯性与季节性消费需求预测母典》第 5 章「需求的相位:气温与需求的回归,以及名义季节的错位」(版本 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}
}

本书其他章节结论