关于「实证闭环:站群规模分层回归、标度指数季报与证伪方案」,《跨尺度转化弹性》给出的定量结论是什么?

结论:第八章给出季度六步流程、合规边界、规模标度弹性检验器与预注册检验方案。书中以标注框区分已发表的证据、可运行的 Python 计算(21 段程序)、原典与作者的假说。

数据口径:书中站数、流量、转化、成本与经营者均为示意;全部计算由书中程序生成;本书是非个人化经营参考,不构成对任何具体经营决策的建议,只讨论以真实主体运营、内容彼此不同的合规站群。 第一章定义转化弹性,示意中含固定开销的成本弹性从 0.158 升到 0.949,含交叉耦合的订单弹性从 0.980 塌到 0.329,饱和池里拆分试验的估计是真实铺开效果的 25.0 倍。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库

Scaling Elasticity Tester (B-248)
points 36, sites per niche 1 to 55
exponent beta0.727, se 0.026, 95% interval 0.674 to 0.779
curvature q-0.094, t(q) = -4.53
verdict: elasticity falls with n: shared pool, grows at scale
log-scale RSS by form: coupled 0.595, overhead 5.971, power 0.983
best form: coupled c51.6357, g=0.0446
local elasticity at n1, 10, 100: 0.955, 0.682, 0.177
tier from n1: 13 points, beta 0.980 (se 0.100)
tier from n5: 10 points, beta 0.764 (se 0.085)
tier from n16: 13 points, beta 0.350 (se 0.101)
forecast at n100: power law 1766.7 (1213.9 to 2571.3)
forecast at n100: best form 954.3
status: candidate only; a person signs off before use
查看完整验算程序
# Chapter 8. p81: the Scaling Elasticity Tester on its seeded demo set.
# This program copies the core of distill/tool.py (log-log fit, the
# curvature test, three forms, tier slopes, forecast) and prints the
# same demo as running "python tool.py" with no arguments. Demo data:
# 36 niche-quarters, n log-uniform 1 to 60, Y = 50 n / (1 + 0.04 (n -
# 1)) exp(e), e ~ N(0, 0.12), seed 20261123 (illustrative).
import math
import random
from statistics import NormalDist


def demo_data():
    rng = random.Random(20261123)
    out = []
    for _ in range(36):
        n = round(math.exp(rng.uniform(0, math.log(60))))
        y = 50 * n / (1 + 0.04 * (n - 1)) * math.exp(rng.gauss(0, 0.12))
        out.append((n, round(y, 1)))
    return out


def tq(df):
    # 0.975 quantile of t, from z with the first Cornish-Fisher term.
    z = NormalDist().inv_cdf(0.975)
    return z + (z ** 3 + z) / (4 * df)


def ols(xs, ys):
    n = len(xs)
    mx, my = math.fsum(xs) / n, math.fsum(ys) / n
    sxx = math.fsum((x - mx) ** 2 for x in xs)
    b = math.fsum((x - mx) * (y - my) for x, y in zip(xs, ys)) / sxx
    a = my - b * mx
    rss = math.fsum((y - a - b * x) ** 2 for x, y in zip(xs, ys))
    return a, b, math.sqrt(rss / (n - 2) / sxx), rss, mx, sxx


def solve(m, v):
    k = len(v)
    a = [row[:] + [v[i]] for i, row in enumerate(m)]
    for c in range(k):
        p = max(range(c, k), key=lambda r: abs(a[r][c]))
        a[c], a[p] = a[p], a[c]
        for r in range(k):
            if r != c:
                f = a[r][c] / a[c][c]
                a[r] = [x - f * y for x, y in zip(a[r], a[c])]
    return [a[i][k] / a[i][i] for i in range(k)]


def curvature(xs, ys):
    cols = [[1.0] * len(xs), xs, [x * x for x in xs]]
    m = [[math.fsum(p * q for p, q in zip(ci, cj)) for cj in cols]
         for ci in cols]
    v = [math.fsum(p * y for p, y in zip(ci, ys)) for ci in cols]
    c = solve(m, v)
    rss = math.fsum((y - c[0] - c[1] * x - c[2] * x * x) ** 2
                    for x, y in zip(xs, ys))
    inv22 = solve(m, [0.0, 0.0, 1.0])[2]
    return c[2], c[2] / math.sqrt(rss / (len(xs) - 3) * inv22)


def log_rss(ns, ys, f):
    return math.fsum((math.log(y) - math.log(f(n))) ** 2
                     for n, y in zip(ns, ys))


def fit_forms(pts):
    ns = [float(n) for n, _ in pts]
    ys = [y for _, y in pts]
    lx = [math.log(n) for n in ns]
    ly = [math.log(y) for y in ys]
    forms = {}
    a, b, _, rss, _, _ = ols(lx, ly)
    forms["power"] = ({"A": math.exp(a), "beta": b}, rss)
    f0, c1, _, _, _, _ = ols(ns, ys)
    if f0 > 0 and c1 > 0:
        forms["overhead"] = ({"F": f0, "c": c1},
                             log_rss(ns, ys, lambda n: f0 + c1 * n))
    i0, s1, _, _, _, _ = ols(ns, [n / y for n, y in zip(ns, ys)])
    if i0 + s1 > 0 and s1 >= 0:
        c, g = 1 / (i0 + s1), s1 / (i0 + s1)
        if g < 1:
            forms["coupled"] = ({"c": c, "g": g}, log_rss(
                ns, ys, lambda n: c * n / (1 + g * (n - 1))))
    return forms


def local_e(form, par, n):
    if form == "power":
        return par["beta"]
    if form == "overhead":
        return par["c"] * n / (par["F"] + par["c"] * n)
    g = par["g"]
    return 1 - g * n / (1 + g * (n - 1))


def value(form, par, n):
    if form == "power":
        return par["A"] * n ** par["beta"]
    if form == "overhead":
        return par["F"] + par["c"] * n
    return par["c"] * n / (1 + par["g"] * (n - 1))


def tier_slopes(pts, lx, ly, tiers):
    out = []
    edges = list(tiers) + [10 ** 9]
    for lo, hi in zip(edges, edges[1:]):
        sel = [(x, y) for (n, _), x, y in zip(pts, lx, ly)
               if lo <= n < hi]
        if len(sel) < 8 or max(s[0] for s in sel) == min(s[0] for s in sel):
            continue
        r = ols([s[0] for s in sel], [s[1] for s in sel])
        out.append({"from": lo, "points": len(sel),
                    "beta": round(r[1], 3), "se": round(r[2], 3)})
    return out


def analyse(pts, target, tiers):
    lx = [math.log(n) for n, _ in pts]
    ly = [math.log(y) for _, y in pts]
    a, b, se, rss, mx, sxx = ols(lx, ly)
    t = tq(len(pts) - 2)
    q, tqv = curvature(lx, ly)
    if abs(tqv) < 2 or abs(q) < 0.02:
        verdict = "constant elasticity: power law, survives scale-up"
    elif q > 0:
        verdict = "elasticity rises with n: fixed overhead, fades at scale"
    else:
        verdict = "elasticity falls with n: shared pool, grows at scale"
    forms = fit_forms(pts)
    best = min(sorted(forms), key=lambda k: forms[k][1])
    par = forms[best][0]
    x0 = math.log(target)
    s2 = rss / (len(pts) - 2)
    pse = math.sqrt(s2 * (1 + 1 / len(pts) + (x0 - mx) ** 2 / sxx))
    nmax = max(n for n, _ in pts)
    nmin = min(n for n, _ in pts)
    return {
        "points": len(pts), "n_range": [nmin, nmax],
        "beta": round(b, 3), "se": round(se, 3),
        "interval": [round(b - t * se, 3), round(b + t * se, 3)],
        "q": round(q, 3), "t_q": round(tqv, 2), "verdict": verdict,
        "forms_rss": {k: round(v[1], 3) for k, v in sorted(forms.items())},
        "best_form": best,
        "best_params": {k: round(v, 4) for k, v in sorted(par.items())},
        "local_elasticity": [round(local_e(best, par, n), 3)
                             for n in (1, 10, 100)],
        "tiers": tier_slopes(pts, lx, ly, tiers),
        "target": target,
        "power_forecast": round(math.exp(a + b * x0), 1),
        "power_interval": [round(math.exp(a + b * x0 - t * pse), 1),
                           round(math.exp(a + b * x0 + t * pse), 1)],
        "best_forecast": round(value(best, par, target), 1),
        "far_extrapolation": target > 2 * nmax or target < nmin / 2,
    }


def report(r):
    lines = [
        "Scaling Elasticity Tester (B-248)",
        "points %d, sites per niche %d to %d"
        % (r["points"], r["n_range"][0], r["n_range"][1]),
        "exponent beta = %.3f, se %.3f, 95%% interval %.3f to %.3f"
        % (r["beta"], r["se"], r["interval"][0], r["interval"][1]),
        "curvature q = %+.3f, t(q) = %+.2f" % (r["q"], r["t_q"]),
        "verdict: " + r["verdict"],
        "log-scale RSS by form: " + ", ".join(
            "%s %.3f" % kv for kv in r["forms_rss"].items()),
        "best form: %s %s" % (r["best_form"], ", ".join(
            "%s=%g" % kv for kv in r["best_params"].items())),
        "local elasticity at n = 1, 10, 100: %s" % ", ".join(
            "%.3f" % v for v in r["local_elasticity"]),
    ]
    for t in r["tiers"]:
        lines.append("tier from n = %d: %d points, beta %.3f (se %.3f)"
                     % (t["from"], t["points"], t["beta"], t["se"]))
    lines.append("forecast at n = %d: power law %.1f (%.1f to %.1f)"
                 % (r["target"], r["power_forecast"],
                    r["power_interval"][0], r["power_interval"][1]))
    lines.append("forecast at n = %d: best form %.1f"
                 % (r["target"], r["best_forecast"]))
    if r["far_extrapolation"]:
        lines.append("warning: target far outside the observed range;"
                     " test before rollout")
    lines.append("status: candidate only; a person signs off before use")
    return lines


for line in report(analyse(demo_data(), 100, [1, 5, 16])):
    print(line)

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《重整化群跨尺度标度律、一人作坊到百站矩阵的转化弹性守恒与经验法则崩塌母典》第 8 章「实证闭环:站群规模分层回归、标度指数季报与证伪方案」(版本 1.0.0). 5D Library. DOI 待发布

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

BibTeX
@book{fan2026248,
  author    = {Fan, Yafu},
  title     = {Renormalisation Group and Cross-Scale Scaling Laws: Which Conversion Elasticities Survive from a One-Person Workshop to a Hundred-Site Matrix},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论