What does Elasticities across Scale conclude, in numbers, about “Closing the Loop: Stratified Regression by Matrix Size, a Quarterly Report on Scaling Exponents and a Falsification Plan”?
Answer: Chapter 8 gives a six-step quarterly procedure, compliance boundaries, the Scaling Elasticity Tester and a pre-registered test. Marked boxes separate published evidence, runnable Python calculations (21 programs), classical sources and the author's hypotheses.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (21 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
| Scaling Elasticity Tester (B-248) | |
| points 36, sites per niche 1 to 55 | |
| exponent beta | 0.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 c | 51.6357, g=0.0446 |
| local elasticity at n | 1, 10, 100: 0.955, 0.682, 0.177 |
| tier from n | 1: 13 points, beta 0.980 (se 0.100) |
| tier from n | 5: 10 points, beta 0.764 (se 0.085) |
| tier from n | 16: 13 points, beta 0.350 (se 0.101) |
| forecast at n | 100: power law 1766.7 (1213.9 to 2571.3) |
| forecast at n | 100: best form 954.3 |
| status: candidate only; a person signs off before use |
Show the full program
# 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)Single source and citation
Fan, Y. (2026). Renormalisation Group and Cross-Scale Scaling Laws: Which Conversion Elasticities Survive from a One-Person Workshop to a Hundred-Site Matrix (Version 1.0.0), Chapter 8: Closing the Loop: Stratified Regression by Matrix Size, a Quarterly Report on Scaling Exponents and a Falsification Plan. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 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}
}Other chapter answers in this book
- Chapter 1 · The Frog in the Well: Conversion Elasticity and the Three Fates of Scale-Up
- Chapter 2 · Estimating a Scaling Exponent from Scattered Points: Intervals, a Curvature Test and the Zeros that Get Dropped
- Chapter 3 · Kadanoff's Block Transform: Which Terms Grow and Which Vanish When Sites Are Merged
- Chapter 4 · Conservation along the Funnel and the Collapse of Profit: Saturating Keyword Pools and Shrinking Pilot Lifts
- Chapter 5 · Finite-Size Scaling: How a Small Matrix Smears the Threshold of a Referral Network
- Chapter 6 · Stratified Regression across Tiers: How One Straight Line Hides a Drifting Elasticity
- Chapter 7 · Classical Sources East and West: the Frog in the Well of the Zhuangzi and Galileo's Square-Cube Law