关于「实战工具与检查器规格:沙盘立项台账、回填校准与预注册检验」,《五方敌对代理兵棋沙盘》给出的定量结论是什么?
结论:第八章给出实战工具与检查器规格、沙盘立项台账与预注册检验:回填之后未加固方案的破产概率改写为 0.6525,加固方案为 0.0040;核心命题的检验每组需要 62 到 199 个方案。书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。
数据口径:本书用一台回合制沙盘证伪它:五类敌对代理,即价格敏感买家、套利投机者、合规审查官、模仿竞争者与流动性冲击,单独出手时最坏只让示意方案的破产概率升到 0.0010;五类同时出手,破产概率是 0.2165,九成五区间从 0.1990 到 0.2351。 书中参数为示意,单位是无币种的点;全部计算由书中程序生成;本书是非个人化经营分析,不构成投资、法律或财务建议,也不构成任何收益承诺;套利代理只用于找出并堵上自家规则漏洞。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.0040, 0.6525, 62
| buy rate: sandbox 0.5611; backfill 62/120 | 0.5167 [0.4281, 0.6042] |
| refund rate: sandbox 0.0410; backfill 5/62 | 0.0806 [0.0349, 0.1753] |
| deviation: buy -0.0444 (-0.079 relative); refund +0.0396 (+0.967) | |
| recalibrated value median 201.9; base refund 0.0596 | |
| plan, sandbox ruin 0.2165 [0.1990, 0.2351] cash | 3,358 |
| plan, backfilled ruin 0.6525 [0.6314, 0.6731] cash | 457 |
| hardened, sandbox ruin 0.0020 [0.0008, 0.0051] cash | 9,302 |
| hardened, backfilled ruin 0.0040 [0.0020, 0.0079] cash | 8,023 |
查看完整验算程序
# Chapter 8. p82: backfilling a small real sample and recalibrating
# The sandbox assumed a buy probability of 0.5611 at list price and a
# base refund rate of 0.02. A synthetic "real" four-week sample of
# 120 visitors is drawn from a world that differs (value median 196,
# base refund 0.07). Wilson intervals test the two assumptions; the
# engine (p13, unchanged) is then recalibrated and rerun.
import math
import random
import statistics
ND = statistics.NormalDist()
AGENTS = ("buyer", "arbitrage", "auditor", "imitator", "liquidity")
PLAN = {"price": 199.0, "cost": 60.0, "fixed": 600.0, "fee": 0.12,
"cash0": 6000.0, "arrivals": 14.0, "med": 210.0, "sig": 0.35,
"window": 14.0, "loopholes": 3.0, "violations": 1.0,
"delay": 8.0, "runrate": 0.02, "freeze": 0.04, "lam": 2.25,
"disc": 0.15, "rate": 0.4, "exploit": 80.0, "audit": 0.06,
"fine": 600.0, "spiral": 0.85, "channels": 1.0,
"hold": 4.0, "rr0": 0.02}
def p_buy(price, ref, lam, eta, med, sig):
if ref >= price:
gl = eta * (ref - price)
else:
gl = -eta * lam * (price - ref)
need = price - gl
if need <= 1.0:
return 1.0
z = (math.log(need) - math.log(med)) / sig
return 1.0 - ND.cdf(z)
def poisson(rng, mu):
if mu <= 0.0:
return 0
lim = math.exp(-mu)
k, p = 0, rng.random()
while p > lim:
k += 1
p *= rng.random()
return k
def run_path(rng, pl, on, horizon=52):
"""One path; returns (ruin_round or 0, max_drawdown, final_cash)."""
cash = pl["cash0"]
peak, mdd = cash, 0.0
ref = pl["price"]
cum, seen, delist = 0.0, 0, 0
due = 0.0
held = {}
hist = []
for t in range(1, horizon + 1):
entered = on["imitator"] and seen and t >= seen + pl["delay"]
price = pl["price"] * (0.9 if entered else 1.0)
arr = pl["arrivals"] * (0.6 if entered else 1.0)
if on["liquidity"] and cash < 0.25 * pl["cash0"]:
price *= pl["spiral"]
if on["buyer"]:
mkt = price * 0.75 if rng.random() < pl["disc"] else price
ref += 0.3 * (mkt - ref)
pb = p_buy(price, ref, pl["lam"], 0.5, pl["med"], pl["sig"])
rr = pl["rr0"] + 0.0015 * pl["window"] + \
0.25 * max(0.0, (price - ref) / price)
else:
pb = p_buy(price, price, 1.0, 0.0, pl["med"], pl["sig"])
rr = pl["rr0"] + 0.0015 * pl["window"]
n = 0
if delist > 0:
delist -= 1
else:
n = poisson(rng, arr * pb)
gross = n * price
net = gross * (1.0 - pl["fee"]) - n * pl["cost"]
refund_now = due
due = poisson(rng, rr * n) * price
inflow = net
if on["liquidity"]:
ch = int(pl["channels"])
parts = [inflow / ch for _ in range(ch)
if rng.random() < pl["freeze"]]
stuck = math.fsum(parts)
back = t + int(pl["hold"])
held[back] = held.get(back, 0.0) + stuck
inflow -= stuck
inflow += held.pop(t, 0.0)
loss = 0.0
if on["arbitrage"]:
loss += pl["exploit"] * poisson(rng, pl["rate"] * pl["loopholes"])
if on["auditor"] and rng.random() < pl["audit"]:
found = 0
for _ in range(int(pl["violations"])):
if rng.random() < 0.7:
found += 1
loss += pl["fine"] * found
if found:
delist = 1
hist.append(gross)
if on["liquidity"] and rng.random() < pl["runrate"]:
phi = rng.uniform(0.10, 0.30)
loss += phi * math.fsum(hist[-8:])
flow = math.fsum([inflow, -pl["fixed"], -refund_now, -loss])
cash += flow
cum += flow
if on["imitator"] and not seen and cum > 3000.0:
seen = t
peak = max(peak, cash)
mdd = max(mdd, peak - cash)
if cash < 0.0:
return t, mdd, cash
return 0, mdd, cash
def wilson(k, n, z=1.959964):
p = k / n
d = 1.0 + z * z / n
c = (p + z * z / (2 * n)) / d
h = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / d
return max(0.0, c - h), min(1.0, c + h)
def scenario(pl, on, n=2000):
rng = random.Random(40613)
res = [run_path(rng, pl, on) for _ in range(n)]
ruins = sorted(r[0] for r in res if r[0])
mdds = sorted(r[1] for r in res)
fin = [r[2] for r in res]
lo, hi = wilson(len(ruins), n)
return {"ruin": len(ruins) / n, "lo": lo, "hi": hi,
"t_med": float(statistics.median(ruins)) if ruins else 0.0,
"mdd50": mdds[n // 2], "mdd95": mdds[int(0.95 * n)],
"cash": math.fsum(fin) / n}
rng = random.Random(40682)
TRUE_PB = p_buy(199.0, 199.0, 1.0, 0.0, 196.0, 0.35)
visits = 120
buys = len([1 for _ in range(visits) if rng.random() < TRUE_PB])
true_rr = 0.07 + 0.0015 * 14
refunds = len([1 for _ in range(buys) if rng.random() < true_rr])
pb_hat, rr_hat = buys / visits, refunds / buys
lo1, hi1 = wilson(buys, visits)
lo2, hi2 = wilson(refunds, buys)
pb0 = p_buy(199.0, 199.0, 1.0, 0.0, PLAN["med"], PLAN["sig"])
rr0 = PLAN["rr0"] + 0.0015 * PLAN["window"]
print("buy rate: sandbox {:.4f}; backfill {}/{} = {:.4f} "
"[{:.4f}, {:.4f}]".format(pb0, buys, visits, pb_hat, lo1, hi1))
print("refund rate: sandbox {:.4f}; backfill {}/{} = {:.4f} "
"[{:.4f}, {:.4f}]".format(rr0, refunds, buys, rr_hat, lo2, hi2))
print("deviation: buy {:+.4f} ({:+.3f} relative); refund {:+.4f} "
"({:+.3f})".format(pb_hat - pb0, (pb_hat - pb0) / pb0,
rr_hat - rr0, (rr_hat - rr0) / rr0))
med = math.exp(math.log(199.0) - 0.35 * ND.inv_cdf(1.0 - pb_hat))
cal = {"med": med, "rr0": rr_hat - 0.0015 * PLAN["window"]}
print("recalibrated value median {:.1f}; base refund {:.4f}".format(
med, cal["rr0"]))
ALL = dict.fromkeys(AGENTS, True)
hard = dict(PLAN, loopholes=0.0, violations=0.0, cash0=9000.0)
for name, pl in (("plan, sandbox", PLAN), ("plan, backfilled",
dict(PLAN, **cal)),
("hardened, sandbox", hard),
("hardened, backfilled", dict(hard, **cal))):
r = scenario(pl, ALL)
print("{:<21} ruin {:.4f} [{:.4f}, {:.4f}] cash {:>6,.0f}".format(
name, r["ruin"], r["lo"], r["hi"], r["cash"]))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《四百卷公理驱动商业兵棋推演、五方敌对代理压力测试与零学费试错沙盘母典》第 8 章「实战工具与检查器规格:沙盘立项台账、回填校准与预注册检验」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-406 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026406,
author = {Fan, Yafu},
title = {Axiom-Driven Business Wargaming, Multi-Agent Adversarial Stress-Testing and Pre-Launch Zero-Tuition Sandboxes},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}