DCT Laboratory — Volume I, Chapter 12
Enterprise Risk, Resilience, and Robustness Architecture
This laboratory demonstrates
Seed 26112 · Companion to Chapter 12 and AXIOM Lab 1.12 (module AXIOM-12) · Mirrored in DCT_V1_Ch12_Lab.xlsx
This laboratory reproduces Worked Example 12.1, What Would Break Meridian?, with the book's declarations, and works the five steps of AXIOM Lab 1.12, Stress-Testing Meridian: build the register, map the armor, shock and recover, race the next shock, cross the threshold. The worked example reads the digital program's 100,000 paths of Worked Example 8.1, drawn as in the book with random seed 8 (Online Appendix 12.B.6), so its tail comes out exactly as printed; Online Appendix 12.B.5's revenue simulation uses the book's seed 12; the lab's seed 26112 is used only for fresh draws, labelled as such. Every Meridian number below is the book's or follows from its declarations (Worked Example 12.1, Tables 12.1 and 12.6, Figures 12.1–12.3, Sections 12.2–12.7, Online Appendix 12.B); the final cell checks the printed ones. Money is in $ million.
The declarations (Worked Example 12.1; Tables 5.2 and 5.4; Chapters 1, 3, 8 and 9)
Today's walls (Table 5.4). Liquidity is $620 million against the board's floor of $350 million. Net leverage is 3.4 times EBITDA against the loan covenant of 4.5, with EBITDA 11.8 percent of revenue of $4.2 billion. Strategic risk is 64 on a 100-point index against the ceiling of 75, measured by the risk committee with an error of points (Table 5.2). Distances are read on the scale Meridian declared in Chapter 3, : liquidity per $0.62 billion, net leverage per 3.4 turns, strategic risk per 100 points.
The digital program (Chapters 1 and 8). Liquidity follows Chapter 1's digital path, read quarterly over the program's three years: from $620 million to a low point of $482 million in quarter 7, and back to $510 million by the end. Strategic risk follows the same model. Execution and market deviation: surprises with a standard deviation of $50 million a quarter, 60 percent carried into the next quarter. Funding-window closures: about one a decade ( a year), each removing a gamma-distributed amount with mean $120 million and standard deviation $50 million that is not recovered within the program. The levers: a standby line that covers up to $100 million of any closure, and a phased build whose cash draw deepens to 20 index points instead of 28. The board's appetite: at most a 5 percent chance of breaching the floor during the program.
Industrial Systems and the regulator (Sections 8.6 and 8.7). The quarterly revenue deviation from plan follows , with shocks of standard deviation $15 million; regulatory interventions arrive at a year. The wiring (Chapter 9): seven components and fourteen arrows of demand, cash, funding, capability and policy.
Python Code
import numpy as np
import matplotlib.pyplot as plt
from math import log, exp, sqrt, ceil, erf
from scipy import stats
plt.rcParams.update({"figure.dpi": 110, "axes.spines.top": False, "axes.spines.right": False})
SEED = 26112 # the lab's seed: fresh draws only, labelled as such
BOOK_SEED = 8 # Worked Example 8.1's 100,000 paths, read by Worked Example 12.1 (Online Appendix 12.B.6)
BOOLE_SEED = 12 # Online Appendix 12.B.5's 200,000 revenue paths
def Phi(z):
return 0.5 * (1 + erf(z / sqrt(2)))
# Today's walls (Table 5.4), the readings they bound, and Meridian's declared scale W_M (Chapter 3); $ million
REVENUE, MARGIN = 4200.0, 0.118 # Chapter 1: revenue and EBITDA margin
LEVERAGE, COVENANT = 3.4, 4.5 # net debt / EBITDA today; the loan covenant
LIQ0, FLOOR = 620.0, 350.0 # liquidity today; the board's floor
RISK0, CEILING, RISK_ERR = 64.0, 75.0, 6.0 # strategic risk today; its ceiling; the committee's error (Table 5.2)
W_M = {"liquidity": 620.0, "net leverage": 3.4, "strategic risk": 100.0} # one unit of each reading's scale
# The digital program: Chapter 1's model, read quarterly (Worked Example 8.1)
QUARTERS, USD_PER_POINT = 12, 6.2
DEPTH, DEPTH_PHASED, LINE, APPETITE = 28.0, 20.0, 100.0, 0.05
def relax(x0, xinf, k, t):
return xinf + (x0 - xinf) * np.exp(-k * t)
def hump(depth, tau, t):
return depth * (t / tau) * np.exp(1 - t / tau)
def plan(depth=DEPTH, t=None):
# liquidity ($ million): Chapter 1's index relaxes from 100 toward 112 at 35% a year, less the program's cash draw
t = np.arange(QUARTERS + 1) / 4 if t is None else np.asarray(t, float)
return USD_PER_POINT * (relax(100.0, 112.0, 0.35, t) - hump(depth, 2.0, t))
def strategic_risk(t):
# Chapter 1's digital path for strategic risk on the book's state: toward 51, with a hump of 14 at 1.2 years
return relax(RISK0, 51.0, 0.40, t) + hump(14.0, 1.2, t)
# Chapter 8's two channels of uncertainty
A_E, SD_W = 0.6, 50.0 # deviation: share carried over; surprise sd a quarter
LAM, J_MEAN, J_SD = 0.10, 120.0, 50.0 # closures a year; closure size: mean and sd
SHAPE, SCALE_G = (J_MEAN / J_SD) ** 2, J_SD ** 2 / J_MEAN
CLOSURE = stats.gamma(SHAPE, scale=SCALE_G) # gamma sizes, as in the book's engine
N_PATHS = 100_000
# Industrial Systems' revenue deviation (Section 8.6) and regulatory interventions (Section 8.7)
A_R, SD_R, LAM_REG = 0.7, 15.0, 0.15
# Chapter 9's wiring: seven components and fourteen typed arrows (from, to, type)
COMPONENTS = ["MKT", "GOV", "MAT", "IND", "DIG", "ENG", "TRS"]
ARROWS = [("MKT", "IND", "demand"), ("MKT", "DIG", "demand"), ("MKT", "MAT", "demand"),
("IND", "TRS", "cash"), ("DIG", "TRS", "cash"), ("MAT", "TRS", "cash"),
("TRS", "IND", "funding"), ("TRS", "DIG", "funding"),
("ENG", "IND", "capability"), ("IND", "ENG", "capability"),
("ENG", "DIG", "capability"), ("DIG", "ENG", "capability"),
("GOV", "TRS", "policy"), ("GOV", "DIG", "policy")]
pl = plan()
print(f"EBITDA: {MARGIN:.1%} of ${REVENUE:,.0f} million = ${MARGIN * REVENUE:.1f} million; net debt {LEVERAGE} times that")
print("the plan by quarter ($ million):", np.round(pl).astype(int))
print(f"its low point: ${pl.min():.0f} million in quarter {pl.argmin()}; ${pl[-1]:.0f} million at the end of year 3")
print(f"closure sizes: gamma, shape {SHAPE:.2f} and scale {SCALE_G:.1f}: mean {CLOSURE.mean():.0f}, sd {CLOSURE.std():.0f}")
print(f"the wiring: {len(COMPONENTS)} components, {len(ARROWS)} arrows")EBITDA: 11.8% of $4,200 million = $495.6 million; net debt 3.4 times that the plan by quarter ($ million): [620 574 540 516 499 488 483 482 484 488 494 502 510] its low point: $482 million in quarter 7; $510 million at the end of year 3 closure sizes: gamma, shape 5.76 and scale 20.8: mean 120, sd 50 the wiring: 7 components, 14 arrows
Panel 1 — Build the register (Theorem 12.1; Tables 12.2–12.3; Online Appendix 12.B.1: value at risk 0 and 100, expected shortfall 80 and 103.2)
AXIOM Lab 1.12, step 1. The enterprise risk vector of Equation 12.1 has ten loss channels, each with a support in Meridian's architecture and a declared measure (Table 12.2). Supports matter: the financial channel reads treasury and the cyber channel Digital, so no treasury dashboard, however refined, can report cyber risk (Proposition 12.1). Table 12.3 says which measures are coherent, and the flag decides what may be netted: expected loss and expected shortfall are coherent; value at risk, the standard deviation and the breach probability are not. Then the preloaded two-loan demonstration (Theorem 12.1(ii)): two independent loans each lose 100 with probability 4 percent. Each has a 95 percent value at risk of 0, the pair 100: value at risk rates the diversified pair riskier than its parts. Expected shortfall reports 80 for each loan and 103.2 for the pair, well below the 160 of the parts. Online Appendix 12.B.1 locates the trap: it opens for tail probabilities , that is at 95 percent and at 99 percent.
Python Code
# Equation 12.1 and Table 12.2: the ten loss channels, their supports in Meridian's architecture, typical measures
CHANNELS = [("R_F", "financial", "treasury", "breach probability of floor and covenant; ES at 0.975"),
("R_O", "operational", "Industrial Systems, Materials", "expected loss plus tail ES"),
("R_S", "strategic", "market, governance", "worst case over a scenario set"),
("R_T", "technological", "Digital, engineering", "expected loss; obsolescence drift"),
("R_C", "cyber", "Digital; informational capital", "event ledger: lambda E[J], lambda E[J^2]"),
("R_G", "governance", "governance", "incident hazard"),
("R_L", "legal and regulatory", "governance, treasury", "event ledger (Theorem 8.4)"),
("R_E", "environmental", "Industrial Systems, Materials", "scenario ES"),
("R_R", "reputational", "market; relational capital", "loss after a shock to trust"),
("R_ESG", "ESG", "group-wide", "composite with declared weights")]
# Table 12.3: the five measures; coherent? what each sees; its honest use
MEASURES = {"expected loss": (True, "the average only", "pricing, budgets, plan lines"),
"standard deviation": (False, "gains and losses alike", "volatility budgets (Theorem 8.3)"),
"value at risk": (False, "one quantile; blind beyond it", "threshold reporting, never netting"),
"expected shortfall": (True, "the average of the tail", "netting, consolidation, appetite"),
"breach probability": (False, "how often, not how deep", "survival odds (Theorem 12.4)")}
# the step's flags: which of Table 12.3's measures each channel's typical measure uses (an event ledger's plan line is an
# expected loss; its risk line is a variance, read as a standard deviation in Section 8.7)
USES = {"R_F": ["breach probability", "expected shortfall"], "R_O": ["expected loss", "expected shortfall"],
"R_T": ["expected loss"], "R_C": ["expected loss", "standard deviation"],
"R_L": ["expected loss", "standard deviation"], "R_E": ["expected shortfall"]}
print(f"{'channel':7s} {'loss':21s} {'support':31s} Table 12.3's measures it uses: coherent?")
for sym, loss, support, measure in CHANNELS:
flags = "; ".join(f"{m} {'yes' if MEASURES[m][0] else 'no'}" for m in USES.get(sym, []))
print(f"{sym:7s} {loss:21s} {support:31s} {flags or 'none of the five: declare it, then flag it'}")
print("Table 12.3:", "; ".join(f"{m} {'coherent' if c else 'not coherent'}" for m, (c, _, _) in MEASURES.items()))
def var_es(values, probs, alpha):
# Theorem 12.1(ii) for a discrete law: VaR = the smallest x with P(L <= x) >= alpha; ES = the average loss over the
# worst 1 - alpha of outcomes (the outcomes beyond VaR, topped up at VaR)
order = np.argsort(values)
v, p = np.asarray(values, float)[order], np.asarray(probs, float)[order]
q = v[np.searchsorted(np.cumsum(p), alpha - 1e-12)]
tail = p[v > q] @ v[v > q] + q * (p[v <= q].sum() - alpha)
return float(q), float(tail / (1 - alpha))
def two_loans(p=0.04, c=100.0, alpha=0.95):
one = var_es([0.0, c], [1 - p, p], alpha)
pair = var_es([0.0, c, 2 * c], [(1 - p) ** 2, 2 * p * (1 - p), p ** 2], alpha)
return one, pair
(VAR1, ES1), (VAR2, ES2) = two_loans()
P_NONE, P_ATMOST = 0.96 ** 2, 1 - 0.04 ** 2
print(f"\ntwo independent loans, each losing 100 with probability 4%: P(the pair loses nothing) = 0.96^2 = {P_NONE:.4f} < 0.95;"
f" P(it loses at most 100) = 1 - 0.04^2 = {P_ATMOST:.4f}")
print(f" 95% value at risk: each loan {VAR1:5.1f}, the pair {VAR2:5.1f}: riskier than the sum of its parts, {2 * VAR1:.0f}")
print(f" 95% expected shortfall: each loan {ES1:5.1f}, the pair {ES2:5.1f}: below the {2 * ES1:.0f} of the parts")
print("\nOnline Appendix 12.B.1: value at risk punishes diversification when 1 - sqrt(alpha) < p <= 1 - alpha")
WINDOW = {alpha: (1 - sqrt(alpha), 1 - alpha) for alpha in (0.95, 0.99)}
for alpha, (lo, hi) in WINDOW.items():
print(f" alpha {alpha:.0%}: {lo:.4f} < p <= {hi:.2f}")
print(" p VaR each VaR pair ES each ES pair (alpha 95%)")
for p in (0.020, 0.025, 0.030, 0.040, 0.050, 0.060):
(v1, e1), (v2, e2) = two_loans(p=p)
print(f" {p:5.3f} {v1:10.0f} {v2:10.0f} {e1:9.1f} {e2:9.1f}" + (" punished" if v2 > 2 * v1 else ""))
(V99, E99), (V99P, E99P) = two_loans(p=0.008, alpha=0.99)
print(f" alpha 99%, p = 0.008: expected shortfall {E99:.1f} each and {E99P:.1f} for the pair; value at risk {V99:.0f} and {V99P:.0f}")
rng = np.random.default_rng(SEED) # fresh draws, lab seed: a million simulated books
n_b = 1_000_000
L1, L2 = 100.0 * (rng.random(n_b) < 0.04), 100.0 * (rng.random(n_b) < 0.04)
for name, x in (("one loan", L1), ("the pair", L1 + L2)):
xs = np.sort(x)
print(f" a million fresh books (seed {SEED}), {name}: VaR {xs[int(np.ceil(0.95 * n_b)) - 1]:.0f},"
f" ES {xs[-int(round(0.05 * n_b)):].mean():.1f}")channel loss support Table 12.3's measures it uses: coherent?
R_F financial treasury breach probability no; expected shortfall yes
R_O operational Industrial Systems, Materials expected loss yes; expected shortfall yes
R_S strategic market, governance none of the five: declare it, then flag it
R_T technological Digital, engineering expected loss yes
R_C cyber Digital; informational capital expected loss yes; standard deviation no
R_G governance governance none of the five: declare it, then flag it
R_L legal and regulatory governance, treasury expected loss yes; standard deviation no
R_E environmental Industrial Systems, Materials expected shortfall yes
R_R reputational market; relational capital none of the five: declare it, then flag it
R_ESG ESG group-wide none of the five: declare it, then flag it
Table 12.3: expected loss coherent; standard deviation not coherent; value at risk not coherent; expected shortfall coherent; breach probability not coherent
two independent loans, each losing 100 with probability 4%: P(the pair loses nothing) = 0.96^2 = 0.9216 < 0.95; P(it loses at most 100) = 1 - 0.04^2 = 0.9984
95% value at risk: each loan 0.0, the pair 100.0: riskier than the sum of its parts, 0
95% expected shortfall: each loan 80.0, the pair 103.2: below the 160 of the parts
Online Appendix 12.B.1: value at risk punishes diversification when 1 - sqrt(alpha) < p <= 1 - alpha
alpha 95%: 0.0253 < p <= 0.05
alpha 99%: 0.0050 < p <= 0.01
p VaR each VaR pair ES each ES pair (alpha 95%)
0.020 0 0 40.0 80.0
0.025 0 0 50.0 100.0
0.030 0 100 60.0 101.8 punished
0.040 0 100 80.0 103.2 punished
0.050 0 100 100.0 105.0 punished
0.060 100 100 100.0 107.2
alpha 99%, p = 0.008: expected shortfall 80.0 each and 100.6 for the pair; value at risk 0 and 100
a million fresh books (seed 26112), one loan: VaR 0, ES 80.5
a million fresh books (seed 26112), the pair: VaR 100, ES 103.4
Panel 2 — Map the armor today (Theorem 12.2; Worked Example 12.1, Step 1: $270 million, $121 million, 11 points; 0.44, 0.32 and 0.11)
AXIOM Lab 1.12, step 2, and Worked Example 12.1, Step 1. Armor is the distance to the nearest wall (Definition 12.7). Meridian has $270 million of cash above the floor, $121 million of EBITDA (24 percent) before net leverage reaches the 4.5-times covenant, and 11 points of strategic risk below the ceiling. A cash loss big enough to break the floor would lift leverage only to 3.9 times, so for cash shocks the floor is the wall that binds. On the declared scale the slacks are 0.44, 0.32 and 0.11: the reverse stress test (Theorem 12.2(iii)) points first at the risk ceiling, a wall the committee measures with an error of points. A search over random shock directions, drawn with the lab's seed, finds what the arithmetic says. Theorem 12.2(ii) then prices the worst case: in Online Appendix 12.B.2's two-by-two table the robust choice raises the guaranteed outcome from 2 to 4 and costs 4.0 in expectation.
Python Code
EBITDA = MARGIN * REVENUE
NET_DEBT = LEVERAGE * EBITDA
EBITDA_AT_COVENANT = NET_DEBT / COVENANT
EBITDA_ARMOR = EBITDA - EBITDA_AT_COVENANT
CASH_ARMOR = LIQ0 - FLOOR
LEV_AFTER = (NET_DEBT + CASH_ARMOR) / EBITDA # a cash loss raises net debt one for one
RISK_ARMOR = CEILING - RISK0
# each wall bounds one reading from one side: (reading, today, limit, direction of a move toward the wall)
WALLS = {"liquidity floor": ("liquidity", LIQ0, FLOOR, -1), "covenant": ("net leverage", LEVERAGE, COVENANT, +1),
"strategic-risk ceiling": ("strategic risk", RISK0, CEILING, +1)}
SLACK = {w: abs(lim - now) for w, (_, now, lim, _) in WALLS.items()}
SCALED = {w: SLACK[w] / W_M[WALLS[w][0]] for w in WALLS}
RADIUS, NEAREST = min(SCALED.values()), min(SCALED, key=SCALED.get)
print(f"{'wall':23s} {'reading':15s} {'today':>6s} {'limit':>6s} {'slack':>6s} {'one unit of scale':>18s} {'scaled slack':>13s}")
for w, (r, now, lim, _) in WALLS.items():
print(f"{w:23s} {r:15s} {now:6.1f} {lim:6.1f} {SLACK[w]:6.1f} {W_M[r]:18.2f} {SCALED[w]:13.3f}")
print(f"EBITDA ${EBITDA:.1f} million, net debt ${NET_DEBT:,.0f} million: the covenant binds at EBITDA ${EBITDA_AT_COVENANT:.1f} million,"
f" so EBITDA can fall ${EBITDA_ARMOR:.1f} million ({EBITDA_ARMOR / EBITDA:.1%})")
print(f"a cash loss of ${CASH_ARMOR:.0f} million breaks the floor and lifts leverage only to {LEV_AFTER:.2f} times: for cash shocks"
" the floor binds")
print(f"the reverse stress test (Theorem 12.2(iii)): radius {RADIUS:.2f}, set by the {NEAREST}: {RISK_ARMOR:.0f} points of armor"
f" against a measurement error of +/-{RISK_ERR:.0f}")
rng = np.random.default_rng(SEED) # fresh draws, lab seed: 200,000 random shock directions
d = rng.standard_normal((200_000, 3))
d /= np.linalg.norm(d, axis=1, keepdims=True)
toward = np.array([WALLS[w][3] for w in WALLS])
sig = np.array([SCALED[w] for w in WALLS])
with np.errstate(divide="ignore"):
size = np.where(d * toward > 0, sig / np.abs(d), np.inf).min(axis=1) # the size at which each direction breaks a wall
b = int(size.argmin())
print(f"200,000 random directions (seed {SEED}): the smallest breaking shock measures {size.min():.4f} on the declared scale and"
f" points along strategic risk (cosine {abs(d[b, 2]):.4f}): the search finds the formula's answer")
# Theorem 12.2(ii): the price of the worst case (Online Appendix 12.B.2): outcomes if the window stays open, or closes
PAYOFF = {"A, commit the cash to the build": (10.0, 2.0), "B, buy protection first": (4.0, 6.0)}
P_SHOCK = 0.2
GUARANTEED = {k: min(v) for k, v in PAYOFF.items()}
MAXMIN = max(GUARANTEED.values())
MINMAX = min(max(v[j] for v in PAYOFF.values()) for j in range(2))
EXPECTED = {k: (1 - P_SHOCK) * v[0] + P_SHOCK * v[1] for k, v in PAYOFF.items()}
ROBUST = max(GUARANTEED, key=GUARANTEED.get)
PREMIUM = max(EXPECTED.values()) - EXPECTED[ROBUST]
print(f"\nthe price of the worst case: the best guaranteed outcome is {MAXMIN:.0f} ({ROBUST}); with foresight {MINMAX:.0f};"
f" the value of foresight {MINMAX - MAXMIN:.0f}")
print("with a 20% chance of a shock the expected outcomes are " + " and ".join(f"{v:.1f} ({k[0]})" for k, v in EXPECTED.items())
+ f": the robust choice costs {PREMIUM:.1f}, the premium for raising the guaranteed outcome from"
f" {min(GUARANTEED.values()):.0f} to {MAXMIN:.0f}")wall reading today limit slack one unit of scale scaled slack liquidity floor liquidity 620.0 350.0 270.0 620.00 0.435 covenant net leverage 3.4 4.5 1.1 3.40 0.324 strategic-risk ceiling strategic risk 64.0 75.0 11.0 100.00 0.110 EBITDA $495.6 million, net debt $1,685 million: the covenant binds at EBITDA $374.5 million, so EBITDA can fall $121.1 million (24.4%) a cash loss of $270 million breaks the floor and lifts leverage only to 3.94 times: for cash shocks the floor binds the reverse stress test (Theorem 12.2(iii)): radius 0.11, set by the strategic-risk ceiling: 11 points of armor against a measurement error of +/-6 200,000 random directions (seed 26112): the smallest breaking shock measures 0.1100 on the declared scale and points along strategic risk (cosine 1.0000): the search finds the formula's answer the price of the worst case: the best guaranteed outcome is 4 (B, buy protection first); with foresight 6; the value of foresight 2 with a 20% chance of a shock the expected outcomes are 8.4 (A) and 4.4 (B): the robust choice costs 4.0, the premium for raising the guaranteed outcome from 2 to 4
Panel 3 — Watch the armor thin (Worked Example 12.1, Step 2; Figure 12.3, left: $270 million to $132 million at quarter 7; 1.4 points at month 11)
Worked Example 12.1, Step 2, and the rest of AXIOM Lab 1.12, step 2. Along the plan the cash armor falls from $270 million to $132 million at quarter 7 and has recovered only to $160 million when the program ends: the build spends $138 million of armor and rebuilds $28 million. For seven quarters, from quarter 4 to quarter 10, it sits below $150 million; with the phased build it never falls below $181 million (Online Appendix 12.B.6). Vulnerability is a property of the state: the same $150 million cash loss is absorbed today and breaks the floor at the low point (Section 12.3). The risk armor thins faster: around month 11 strategic risk stands 1.4 points under the ceiling, less than a quarter of the measurement error, about 0.014 on the declared scale against the floor's 0.21 at the liquidity low point. Of the two walls the plan tracks, the risk ceiling is the nearer in every quarter (the plan declares no leverage path, so the covenant's armor is read only today).
Python Code
q = np.arange(QUARTERS + 1)
ARMOR, ARMOR_PH = plan() - FLOOR, plan(DEPTH_PHASED) - FLOOR
K_LOW = int(ARMOR.argmin())
THIN = q[ARMOR < 150]
REBUILD = np.diff(ARMOR)[K_LOW:]
MED, P90 = float(CLOSURE.median()), float(CLOSURE.ppf(0.9))
PRINTED_PLAN = [270, 224, 190, 166, 149, 138, 133, 132, 134, 138, 144, 152, 160] # Online Appendix 12.B.6
PRINTED_PHASED = [270, 239, 216, 200, 190, 184, 181, 181, 183, 187, 193, 199, 206]
print("quarter " + "".join(f"{k:5d}" for k in q))
print("plan armor " + "".join(f"{a:5.0f}" for a in ARMOR))
print("phased armor " + "".join(f"{a:5.0f}" for a in ARMOR_PH))
GAP_PLAN = float(np.abs(np.round(ARMOR) - PRINTED_PLAN).max())
GAP_PHASED = float(np.abs(np.round(ARMOR_PH) - PRINTED_PHASED).max())
print(f"largest gap to Online Appendix 12.B.6's rows, rounded: {GAP_PLAN:.0f} and {GAP_PHASED:.0f}")
print(f"the low point: ${ARMOR.min():.0f} million at quarter {K_LOW}; ${ARMOR[-1]:.0f} million at the end: the build spends"
f" ${ARMOR[0] - ARMOR.min():.0f} million of armor and rebuilds ${ARMOR[-1] - ARMOR.min():.0f} million")
print(f"below $150 million in quarters {THIN.min()}-{THIN.max()} ({len(THIN)} quarters); after the low point it rebuilds"
f" ${REBUILD.min():.1f}-{REBUILD.max():.1f} million a quarter")
print(f"the phased build's armor never falls below ${ARMOR_PH.min():.0f} million")
print(f"closures: median ${MED:.0f} million, 90th percentile ${P90:.0f} million")
print(f"vulnerability (Section 12.3): a $150 million cash loss is absorbed today ({ARMOR[0]:.0f} of armor) and breaks the floor"
f" at the low point ({ARMOR.min():.0f})")
tt = np.round(np.arange(0, 3.0005, 0.001), 3) # three years, every 0.001 year
RISK_PATH = strategic_risk(tt)
T_PEAK, PEAK = float(tt[RISK_PATH.argmax()]), float(RISK_PATH.max())
PEAK_ARMOR = CEILING - PEAK
RISK_AT_LOW = float(strategic_risk(K_LOW / 4))
print(f"\nstrategic risk peaks at {PEAK:.2f} at month {12 * T_PEAK:.1f}: {PEAK_ARMOR:.2f} points under the ceiling,"
f" {PEAK_ARMOR / RISK_ERR:.0%} of the +/-6-point error")
print(f"on the declared scale: the risk slack is {PEAK_ARMOR / W_M['strategic risk']:.4f} at its peak; at the liquidity low point"
f" the floor's is {ARMOR.min() / W_M['liquidity']:.3f} and the risk ceiling's {(CEILING - RISK_AT_LOW) / W_M['strategic risk']:.3f}")
SC_FLOOR = ARMOR / W_M["liquidity"]
SC_RISK = (CEILING - strategic_risk(q / 4)) / W_M["strategic risk"]
print("the nearer wall, quarter by quarter:", "".join("R" if r < f else "F" for f, r in zip(SC_FLOOR, SC_RISK)),
"(R the risk ceiling, F the floor)")
fig, (ax, bx) = plt.subplots(1, 2, figsize=(7.6, 3.6))
ax.axvspan(THIN.min(), THIN.max(), color="#F6E3E3", lw=0)
ax.plot(q, ARMOR, color="#1F4E79", lw=2, marker="o", ms=3, label="plan as designed")
ax.plot(q, ARMOR_PH, color="#2E7D32", lw=1.6, ls="--", label="phased build")
ax.axhline(P90, color="#B71C1C", lw=0.9, ls=":", label=f"closure, 90th percentile {P90:.0f}")
ax.axhline(MED, color="#B71C1C", lw=0.9, ls="--", label=f"closure, median {MED:.0f}")
ax.text((THIN.min() + THIN.max()) / 2, 292, "thin window", ha="center", va="top", fontsize=7, color="#B71C1C")
ax.annotate(f"low point {ARMOR.min():.0f}\nat quarter {K_LOW}", xy=(K_LOW, ARMOR.min()), xytext=(8.6, 40), fontsize=7,
color="#1F4E79", ha="left", arrowprops=dict(arrowstyle="-", color="#1F4E79", lw=0.6))
ax.set(xlabel="quarter of the program", ylabel="cash armor above the floor (\\$ million)", xlim=(0, 12), ylim=(0, 300),
xticks=range(0, 13, 2))
ax.legend(frameon=False, fontsize=7, loc="lower left")
months = 12 * tt
bx.fill_between(months, CEILING - RISK_PATH - RISK_ERR, CEILING - RISK_PATH + RISK_ERR, color="#1F4E79", alpha=0.13, lw=0,
label="±6-point measurement error")
bx.plot(months, CEILING - RISK_PATH, color="#1F4E79", lw=2, label="strategic-risk armor")
bx.axhline(0, color="#B71C1C", lw=1.1)
bx.text(36, 0.5, "ceiling 75", ha="right", va="bottom", fontsize=7, color="#B71C1C")
bx.annotate(f"{PEAK_ARMOR:.1f} points\nat month {12 * T_PEAK:.0f}", xy=(12 * T_PEAK, PEAK_ARMOR), xytext=(16, -6.5), fontsize=7,
color="#1F4E79", ha="left", arrowprops=dict(arrowstyle="-", color="#1F4E79", lw=0.6))
bx.set(xlabel="month of the program", ylabel="points below the ceiling", xlim=(0, 36), ylim=(-8, 20), xticks=range(0, 37, 6))
bx.legend(frameon=False, fontsize=7, loc="upper center")
for z in (ax, bx):
z.tick_params(labelsize=7); z.xaxis.label.set_size(8); z.yaxis.label.set_size(8)
fig.suptitle(f"The armor thins: \\${ARMOR.min():.0f} million of cash, {PEAK_ARMOR:.1f} points of risk (seed {SEED})", fontsize=10)
plt.tight_layout(); plt.show()quarter 0 1 2 3 4 5 6 7 8 9 10 11 12 plan armor 270 224 190 166 149 138 133 132 134 138 144 152 160 phased armor 270 239 216 200 190 184 181 181 183 187 193 199 206 largest gap to Online Appendix 12.B.6's rows, rounded: 0 and 0 the low point: $132 million at quarter 7; $160 million at the end: the build spends $138 million of armor and rebuilds $28 million below $150 million in quarters 4-10 (7 quarters); after the low point it rebuilds $1.9-8.5 million a quarter the phased build's armor never falls below $181 million closures: median $113 million, 90th percentile $187 million vulnerability (Section 12.3): a $150 million cash loss is absorbed today (270 of armor) and breaks the floor at the low point (132) strategic risk peaks at 73.55 at month 10.9: 1.45 points under the ceiling, 24% of the +/-6-point error on the declared scale: the risk slack is 0.0145 at its peak; at the liquidity low point the floor's is 0.213 and the risk ceiling's 0.046 the nearer wall, quarter by quarter: RRRRRRRRRRRRR (R the risk ceiling, F the floor)

Panel 4 — Read the tail (Worked Example 12.1, Step 3; Figure 12.3, right: 24.6 percent, $72 million, value at risk $231 million, expected shortfall $166 million)
Worked Example 12.1, Step 3. Robustness says what is guaranteed; risk says what is likely. Over Chapter 8's 100,000 simulated paths, drawn as in the book with seed 8, the program's lowest liquidity breaches the floor on 24.6 percent of paths, by $72 million on average when it does (median $51 million). The 95 percent value at risk of the low point is $231 million, $119 million below the floor: one path in twenty falls at least that low. The expected shortfall is $166 million: the worst one path in twenty averages a low point $184 million below the floor. The two numbers answer different questions, how often and how deep. Online Appendix 12.B.6 adds the 10 and 1 percent levels: quantiles of 282 and 127, expected shortfalls of 213 and 66.
Python Code
def simulate(line=0.0, depth=DEPTH, n=N_PATHS, seed=BOOK_SEED):
# Worked Example 8.1's quarterly liquidity paths [n, 13] and each path's closures. The draws follow the book's engine,
# in its order: each quarter the n surprises, the n closure counts, then the sizes of that quarter's closures in path
# order. A standby line covers up to `line` of each closure. Seed 8 gives the book's paths.
rng = np.random.default_rng(seed)
pl_, E, J = plan(depth), np.zeros(n), np.zeros(n)
L = np.empty((n, QUARTERS + 1)); L[:, 0] = pl_[0]
closures = np.zeros(n, dtype=int)
for k in range(QUARTERS):
w = SD_W * rng.standard_normal(n)
cnt = rng.poisson(LAM / 4, n)
sizes = rng.gamma(SHAPE, SCALE_G, cnt.sum())
lost = np.bincount(np.repeat(np.arange(n), cnt), np.maximum(sizes - line, 0.0), minlength=n)
E, J, closures = A_E * E + w, J - lost, closures + cnt
L[:, k + 1] = pl_[k + 1] + E + J
return L, closures
def tail(lows, alpha=0.95):
# how often and how deep: the breach odds, and the value at risk and expected shortfall of the low point (as levels)
q_ = float(np.percentile(lows, 100 * (1 - alpha)))
return float((lows < FLOOR).mean()), q_, float(lows[lows <= q_].mean())
L0, CL0 = simulate() # the book's paths: seed 8
LOWS0 = L0[:, 1:].min(axis=1)
P0, VAR0, ES0 = tail(LOWS0)
SE0 = sqrt(P0 * (1 - P0) / N_PATHS)
DEPTHS = FLOOR - LOWS0[LOWS0 < FLOOR]
print(f"the book's {N_PATHS:,} paths (seed {BOOK_SEED}): the low point breaches the floor on {P0:.2%} of paths"
f" (standard error {100 * SE0:.2f} points),")
print(f" by ${DEPTHS.mean():.0f} million on average when it does (median ${np.median(DEPTHS):.0f} million)")
print(f"95% value at risk of the low point: ${VAR0:.0f} million, ${FLOOR - VAR0:.0f} million below the floor")
print(f"95% expected shortfall: ${ES0:.0f} million, the worst one path in twenty averaging ${FLOOR - ES0:.0f} million below the floor")
TAILS = {a: tail(LOWS0, a)[1:] for a in (0.90, 0.95, 0.99)}
print(" worst share quantile of the low point expected shortfall")
for a, (v, e) in TAILS.items():
print(f" {1 - a:11.0%} {v:26.0f} {e:20.0f}")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
bins = np.arange(-110, 711, 20) # bins break at the floor
cnt_, edges = np.histogram(LOWS0, bins=bins)
mid = (edges[1:] + edges[:-1]) / 2
ax.bar(mid, 100 * cnt_ / N_PATHS, width=19, color=["#B71C1C" if m < FLOOR else "#9DB3CC" for m in mid], lw=0)
ax.axvline(FLOOR, color="#212121", lw=1.1, label=f"floor {FLOOR:.0f}")
ax.axvline(VAR0, color="#E65100", lw=1.3, ls="--", label=f"95% value at risk {VAR0:.0f}")
ax.axvline(ES0, color="#1F4E79", lw=1.3, ls=":", label=f"expected shortfall {ES0:.0f}")
ax.text(60, 4.5, f"breach\n{P0:.1%}", ha="center", va="center", fontsize=8, color="#B71C1C")
ax.set(xlabel="the program's lowest liquidity (\\$ million)", ylabel="share of paths (%)", xlim=(-100, 700), ylim=(0, 17),
title=f"How often and how deep: the program's low point (seed {BOOK_SEED}, the book's paths)")
ax.title.set_size(11)
ax.legend(frameon=False, fontsize=8, loc="upper left")
plt.tight_layout(); plt.show()the book's 100,000 paths (seed 8): the low point breaches the floor on 24.62% of paths (standard error 0.14 points),
by $72 million on average when it does (median $51 million)
95% value at risk of the low point: $231 million, $119 million below the floor
95% expected shortfall: $166 million, the worst one path in twenty averaging $184 million below the floor
worst share quantile of the low point expected shortfall
10% 282 213
5% 231 166
1% 127 66

Panel 5 — Shock and recover (Theorem 12.3; Figure 12.1: 7 quarters to a tenth, back in the band after 2.7, 3.8 percent near plan, $50 million below plan under stress)
AXIOM Lab 1.12, step 3. Hit Industrial Systems with a $90 million demand shock. Its deviation follows Section 8.6's law, so the stationary fan has a standard deviation of $21 million and a 90 percent band of ±$34.5 million. The recovery clock (Equation 12.2, with and ) brings the expected path within a tenth of the shock, $9 million, in 7 quarters, but it re-enters the band after 2.7 quarters, and the band is the honest target (Theorem 12.3(iv)): Industrial Systems is back inside it three quarters after the shock (Table 12.1). A report that waits for revenue to return to plan will report failure indefinitely: in any quarter, revenue is within $1 million of plan only 3.8 percent of the time. Then hold a sustained shortfall of $15 million a quarter: it does not delay the recovery; it moves the equilibrium to $50 million below plan, times the quarterly stress (Theorem 12.3(iii)). Fresh paths drawn with the lab's seed show both. Resilience is two numbers (Theorem 12.3(ii)): company A, rate 2 within a margin of 1, heals a shock of 0.5 in 1.2 time units against B's 11.5 (rate 0.2, margin 10), but a shock of 5 ends A's regime while B heals it in 23.
Python Code
SD_INF = SD_R / sqrt(1 - A_R ** 2)
Z90 = float(stats.norm.ppf(0.95))
BAND = Z90 * SD_INF
SHOCK, STRESS = 90.0, 15.0
def clock(s, eps, theta, C=1.0):
# Equation 12.2 before rounding up: the periods for C theta^k s to fall to eps
return log(C * s / eps) / log(1 / theta)
K_EPS = ceil(clock(SHOCK, SHOCK / 10, A_R))
K_BAND = clock(SHOCK, BAND, A_R)
K_IN = next(k for k in range(60) if SHOCK * A_R ** k <= BAND)
P_NEAR = 2 * Phi(1 / SD_INF) - 1
EQ = -STRESS / (1 - A_R)
print(f"the stationary fan: standard deviation ${SD_INF:.1f} million; 90% band +/-${BAND:.1f} million")
print(f"a ${SHOCK:.0f} million shock: within a tenth (${SHOCK / 10:.0f} million) after {clock(SHOCK, SHOCK / 10, A_R):.2f} quarters,"
f" so k = {K_EPS} by Equation 12.2; back inside the band after {K_BAND:.2f} quarters, inside it from quarter {K_IN}")
print("the expected deviation, quarters 0-8:", np.round(-SHOCK * A_R ** np.arange(9), 1))
print(f"in any quarter, revenue is within $1 million of plan with probability 2 Phi(1/{SD_INF:.0f}) - 1 = {P_NEAR:.1%}")
print(f"a sustained shortfall of ${STRESS:.0f} million a quarter moves the equilibrium to {EQ:.0f}, {1 / (1 - A_R):.2f} times the"
f" stress; the gap to it shrinks by the same factor {A_R} a quarter (Theorem 12.3(iii))")
rng = np.random.default_rng(SEED) # fresh draws, lab seed: 100,000 paths after the shock
NR, KR = 100_000, 40
R = np.empty((NR, KR + 1)); RS = np.empty((NR, KR + 1))
R[:, 0], RS[:, 0] = -SHOCK, 0.0
for k in range(KR):
w = SD_R * rng.standard_normal(NR)
R[:, k + 1] = A_R * R[:, k] + w
RS[:, k + 1] = A_R * RS[:, k] - STRESS + w # the same surprises under the sustained shortfall
INSIDE = (np.abs(R) <= BAND).mean(axis=0)
print(f"fresh paths (seed {SEED}): inside the band after 1, 3, 8 and 40 quarters: "
+ ", ".join(f"{INSIDE[k]:.1%}" for k in (1, 3, 8, 40)))
print(f" within $1 million of plan after 40 quarters: {(np.abs(R[:, 40]) <= 1).mean():.1%}; under the stress, the mean after"
f" 40 quarters is {RS[:, 40].mean():.1f} and {(np.abs(RS[:, 40] - EQ) <= BAND).mean():.1%} of paths sit inside the stressed band")
COMPANY = {"A": (2.0, 1.0), "B": (0.2, 10.0)} # (rate, margin): Theorem 12.3(ii) and Figure 12.1
def heal(rate, margin, s, eps=0.05):
# the time a surviving shock takes to reach the tolerance, or None if it ends the regime
return log(s / eps) / rate if s < margin else None
HEAL = {(c, s): heal(*COMPANY[c], s) for c in COMPANY for s in (0.5, 5.0)}
for s in (0.5, 5.0):
print(f"a shock of {s}: " + "; ".join(f"{c} " + (f"heals in {HEAL[(c, s)]:.2f}" if HEAL[(c, s)] is not None
else "leaves its regime") for c in COMPANY))
fig, (ax, bx) = plt.subplots(1, 2, figsize=(7.6, 3.6), sharey=True)
kk = np.arange(17)
for z, paths, centre, label in ((ax, R, 0.0, "after a \\$90 million shock"), (bx, RS, EQ, "under a sustained \\$15 million shortfall")):
z.axhspan(centre - BAND, centre + BAND, color="#1F4E79", alpha=0.10, lw=0)
for i in range(25):
z.plot(kk, paths[i, :17], color="#999999", lw=0.5, alpha=0.7)
z.axhline(0, color="#616161", lw=0.7, ls="--")
z.set(xlabel="quarters", xlim=(0, 16), xticks=range(0, 17, 4))
z.set_title(label, fontsize=9)
z.tick_params(labelsize=7); z.xaxis.label.set_size(8)
ax.plot(kk, -SHOCK * A_R ** kk, color="#1F4E79", lw=2, label="expected path")
ax.plot([K_BAND], [-BAND], "o", color="#1F4E79", ms=4)
ax.annotate(f"inside the 90% band\nafter {K_BAND:.1f} quarters", xy=(K_BAND, -BAND), xytext=(5.5, -78), fontsize=7, color="#1F4E79",
arrowprops=dict(arrowstyle="-", color="#1F4E79", lw=0.6))
ax.text(0.3, BAND + 2, f"90% band ±{BAND:.1f}", ha="left", va="bottom", fontsize=7, color="#616161")
ax.text(0.3, 2, "plan", fontsize=7, color="#616161", va="bottom")
bx.plot(kk, EQ * (1 - A_R ** kk), color="#E65100", lw=2, label="expected path")
bx.axhline(EQ, color="#E65100", lw=0.8, ls=":")
bx.text(0.3, -106, f"stressed equilibrium {EQ:.0f}, band ±{BAND:.1f}", ha="left", va="bottom", fontsize=7, color="#E65100")
ax.set_ylabel("revenue against plan (\\$ million)", fontsize=8)
ax.set_ylim(-110, 60)
for z in (ax, bx):
z.legend(frameon=False, fontsize=7, loc="upper right")
fig.suptitle(f"Recovery is to the band, and a sustained stress moves the band (seed {SEED})", fontsize=10)
plt.tight_layout(); plt.show()the stationary fan: standard deviation $21.0 million; 90% band +/-$34.5 million a $90 million shock: within a tenth ($9 million) after 6.46 quarters, so k = 7 by Equation 12.2; back inside the band after 2.68 quarters, inside it from quarter 3 the expected deviation, quarters 0-8: [-90. -63. -44.1 -30.9 -21.6 -15.1 -10.6 -7.4 -5.2] in any quarter, revenue is within $1 million of plan with probability 2 Phi(1/21) - 1 = 3.8% a sustained shortfall of $15 million a quarter moves the equilibrium to -50, 3.33 times the stress; the gap to it shrinks by the same factor 0.7 a quarter (Theorem 12.3(iii)) fresh paths (seed 26112): inside the band after 1, 3, 8 and 40 quarters: 2.8%, 57.4%, 89.1%, 90.0% within $1 million of plan after 40 quarters: 3.7%; under the stress, the mean after 40 quarters is -49.9 and 90.0% of paths sit inside the stressed band a shock of 0.5: A heals in 1.15; B heals in 11.51 a shock of 5.0: A leaves its regime; B heals in 23.03

Panel 6 — Race the next shock (Theorem 12.4; Worked Example 12.1, Step 4; Online Appendix 12.B.5: 23, 16 and 36 percent; 19.3 against 12.4 percent)
AXIOM Lab 1.12, step 4, first part, and Worked Example 12.1, Step 4. The race number of Theorem 12.4(iii) is . Industrial Systems needs 7 quarters to work the $90 million shock down to a tenth, and regulatory interventions arrive about once in 6.7 years: the next one lands while the division is still recovering with probability 23 percent. For the program, the shock that matters is a closed funding window, about one a decade: one lands in the seven thin quarters with probability 16 percent, and a closure at the low point exceeds the $132 million of armor with probability 36 percent. After the low point the plan rebuilds armor at only $1.9–8.5 million a quarter, so the race must be won with armor, not with speed. Survivable shocks ratchet: one median closure ($113 million) is survived in every quarter, but two exceed the armor in every quarter from the first on (Online Appendix 12.B, Theorem 12.4). Parts (i) and (ii) supply the reporting beneath: on the book's paths the breach odds are the product of quarterly hazards, and Boole's summed floor is conservative. For Industrial Systems' revenue, a quarter more than $45 million below plan has probability 1.6 percent, so the floor is 19.3 percent over twelve quarters and 6.4 over four, while 200,000 stationary paths drawn with the book's seed 12 give 12.4 and 4.9 percent (Online Appendix 12.B.5).
Python Code
def race(lam_year, quarters):
# Theorem 12.4(iii): the chance that the next shock arrives within `quarters`
return 1 - exp(-lam_year * quarters / 4)
RACE_REG = race(LAM_REG, K_EPS)
RACE_THIN = race(LAM, len(THIN))
P_EXCEED_LOW = float(CLOSURE.sf(ARMOR.min()))
print(f"interventions at {LAM_REG} a year (one every {1 / LAM_REG:.1f} years) against a {K_EPS}-quarter recovery:"
f" 1 - e^(-{LAM_REG} x {K_EPS}/4) = {RACE_REG:.1%}")
print(f"closures at {LAM:.2f} a year in the {len(THIN)} thin quarters: 1 - e^(-{LAM:.2f} x {len(THIN)}/4) = {RACE_THIN:.1%}")
print(f"a closure at the low point exceeds the ${ARMOR.min():.0f} million of armor with probability {P_EXCEED_LOW:.1%}")
print(f"after the low point the plan rebuilds only ${REBUILD.min():.1f}-{REBUILD.max():.1f} million a quarter: win the race with armor")
print("the race number by recovery time (quarters): " + "".join(f"{T:7d}" for T in (1, 2, 4, 7, 12)))
for lam_, what in ((LAM, "closures, 0.10 a year"), (LAM_REG, "interventions, 0.15 a year")):
print(f" {what:42s}" + "".join(f"{race(lam_, T):7.1%}" for T in (1, 2, 4, 7, 12)))
print(f"the ratchet: one median closure (${MED:.0f} million) is survived in every quarter (armor at least ${ARMOR.min():.0f});"
f" two (${2 * MED:.0f} million) exceed the armor in every quarter from the first on (at most ${ARMOR[1:].max():.0f})")
below = L0[:, 1:] < FLOOR # the book's paths (seed 8)
first = np.where(below.any(axis=1), below.argmax(axis=1) + 1, 0)
HAZ, SURV, s_ = [], [], 1.0
for j in range(1, QUARTERS + 1):
alive = (first == 0) | (first >= j)
HAZ.append(float((first == j).sum() / alive.sum()))
s_ *= 1 - HAZ[-1]; SURV.append(s_)
P_QUARTER = below.mean(axis=0)
print(f"\nTheorem 12.4(i) on the book's paths (seed {BOOK_SEED}): the hazard of a first breach by quarter (%):",
" ".join(f"{100 * h:.1f}" for h in HAZ))
print(f" survival S(12) = the product of (1 - h) = {SURV[-1]:.4f}, so the breach odds are {1 - SURV[-1]:.2%}; the hazard peaks in"
f" quarter {int(np.argmax(HAZ)) + 1}, inside the thin window")
print(f"Theorem 12.4(ii) on the same paths: the summed floor, {P_QUARTER.sum():.1%}, is far above {P0:.1%}: bad quarters come in runs")
P1Q = Phi(-45 / SD_INF)
def boole_sim(horizon, level=-45.0, n=200_000, seed=BOOLE_SEED):
# Online Appendix 12.B.5: n stationary revenue paths; the share with at least one quarter below `level`
rng = np.random.default_rng(seed)
r = rng.normal(0.0, SD_INF, n)
hit = np.zeros(n, dtype=bool)
for _ in range(horizon):
r = A_R * r + rng.normal(0.0, SD_R, n)
hit |= r < level
return float(hit.mean())
SIM12, SIM4 = boole_sim(12), boole_sim(4)
print(f"\nIndustrial Systems: a quarter more than $45 million below plan has probability Phi(-45/21) = {P1Q:.2%}")
for h_, sim in ((12, SIM12), (4, SIM4)):
print(f" over {h_:2d} quarters: Boole's floor {h_} x {P1Q:.2%} = {h_ * P1Q:.1%}; 200,000 stationary paths (seed {BOOLE_SEED}):"
f" {sim:.1%} +/- {sqrt(sim * (1 - sim) / 200_000):.2%}")interventions at 0.15 a year (one every 6.7 years) against a 7-quarter recovery: 1 - e^(-0.15 x 7/4) = 23.1% closures at 0.10 a year in the 7 thin quarters: 1 - e^(-0.10 x 7/4) = 16.1% a closure at the low point exceeds the $132 million of armor with probability 35.6% after the low point the plan rebuilds only $1.9-8.5 million a quarter: win the race with armor the race number by recovery time (quarters): 1 2 4 7 12 closures, 0.10 a year 2.5% 4.9% 9.5% 16.1% 25.9% interventions, 0.15 a year 3.7% 7.2% 13.9% 23.1% 36.2% the ratchet: one median closure ($113 million) is survived in every quarter (armor at least $132); two ($226 million) exceed the armor in every quarter from the first on (at most $224) Theorem 12.4(i) on the book's paths (seed 8): the hazard of a first breach by quarter (%): 0.2 0.8 1.7 2.5 3.1 3.5 3.4 3.1 2.9 2.5 2.3 1.9 survival S(12) = the product of (1 - h) = 0.7538, so the breach odds are 24.62%; the hazard peaks in quarter 6, inside the thin window Theorem 12.4(ii) on the same paths: the summed floor, 81.4%, is far above 24.6%: bad quarters come in runs Industrial Systems: a quarter more than $45 million below plan has probability Phi(-45/21) = 1.61% over 12 quarters: Boole's floor 12 x 1.61% = 19.3%; 200,000 stationary paths (seed 12): 12.4% +/- 0.07% over 4 quarters: Boole's floor 4 x 1.61% = 6.4%; 200,000 stationary paths (seed 12): 4.9% +/- 0.05%
Panel 7 — Buy armor (Worked Example 12.1, Step 5; Table 12.6: 12.4, 13.1 and 3.0 percent; with both levers value at risk $367 million, expected shortfall $332 million)
AXIOM Lab 1.12, step 4, second part, and Worked Example 12.1, Step 5. Run the simulation, with its error bar, with and without the levers. The standby line leaves the plan's armor at $132 million but covers $100 million of any closure, so only a closure above $232 million breaks the floor at the low point, a 2.8 percent chance; the breach odds halve to 12.4 percent. Phasing the build raises the armor itself, to $181 million (12 percent). With both, a closure must exceed $281 million, a 0.6 percent chance, and the breach odds fall to 3.0 percent, within the appetite. Every configuration reuses the book's draws (seed 8); standard errors are at most 0.14 points. Yet with both levers the 95 percent value at risk of the low point sits $17 million above the floor while the expected shortfall sits $18 million below it: an appetite stated only as a probability is a value-at-risk statement, blind beyond its threshold (Theorem 12.1). A fresh stream drawn with the lab's seed shows the error bar at work.
Python Code
CONFIGS = [("Plan as designed", 0.0, DEPTH), ("Standby line", LINE, DEPTH),
("Phased build", 0.0, DEPTH_PHASED), ("Both levers", LINE, DEPTH_PHASED)]
T126 = []
for name, line, depth in CONFIGS:
armor = float((plan(depth) - FLOOR).min())
L, _ = simulate(line=line, depth=depth) # the book's draws (seed 8) under each configuration
p, var, es = tail(L[:, 1:].min(axis=1))
T126.append(dict(name=name, armor=armor, line=line, exceed=float(CLOSURE.sf(armor + line)), p=p,
se=sqrt(p * (1 - p) / N_PATHS), var=var, es=es))
print(f"Table 12.6 (seed {BOOK_SEED}, {N_PATHS:,} paths each; $ million)")
print(f" {'configuration':17s} {'armor':>10s} {'closure exceeds it':>19s} {'breach':>7s} {'s.e.':>5s} {'VaR':>5s} {'ES':>5s}")
for r in T126:
arm = f"{r['armor']:.0f}" + (f" + {r['line']:.0f}" if r["line"] else "")
print(f" {r['name']:17s} {arm:>10s} {r['exceed']:19.1%} {r['p']:7.1%} {100 * r['se']:5.2f} {r['var']:5.0f} {r['es']:5.0f}")
BOTH = T126[3]
print(f"the standby line cuts the odds to {T126[1]['p'] / P0:.2f} of the plan's; with both levers the odds ({BOTH['p']:.1%}) meet the"
f" {APPETITE:.0%} appetite,")
print(f" the value at risk sits ${BOTH['var'] - FLOOR:.0f} million above the floor, and the expected shortfall"
f" ${FLOOR - BOTH['es']:.0f} million below it")
Lf, _ = simulate(seed=SEED) # fresh draws, lab seed: not the book's paths
PF, VF, EF = tail(Lf[:, 1:].min(axis=1))
print(f"a fresh stream of {N_PATHS:,} paths (seed {SEED}): breach {PF:.2%}, {(PF - P0) / SE0:+.1f} standard errors from the book's;"
f" value at risk {VF:.0f}, expected shortfall {EF:.0f}: tail numbers carry Monte Carlo error too")Table 12.6 (seed 8, 100,000 paths each; $ million) configuration armor closure exceeds it breach s.e. VaR ES Plan as designed 132 35.6% 24.6% 0.14 231 166 Standby line 132 + 100 2.8% 12.4% 0.10 320 286 Phased build 181 11.6% 13.1% 0.11 278 213 Both levers 181 + 100 0.6% 3.0% 0.05 367 332 the standby line cuts the odds to 0.50 of the plan's; with both levers the odds (3.0%) meet the 5% appetite, the value at risk sits $17 million above the floor, and the expected shortfall $18 million below it a fresh stream of 100,000 paths (seed 26112): breach 24.40%, -1.7 standard errors from the book's; value at risk 232, expected shortfall 168: tail numbers carry Monte Carlo error too
Panel 8 — Cross the threshold (Theorem 12.5; Figure 12.2; Online Appendix 12.B.3–12.B.4: multipliers 2, 5 and 10; 1.9, 1.1 and 0.9 at ; nearly five times)
AXIOM Lab 1.12, step 5. Chapter 9's wiring has one feedback core: Industrial Systems, Digital, engineering and treasury, a four-cycle whose every link runs both ways, with no arrow leaving it. A shock at Digital reaches engineering and treasury in one quarter and Industrial Systems in two (Theorem 12.5(i)); a demand shock reaches the divisions in one quarter and treasury in two. If each arrow passes on a share of the loss arriving at its source each quarter, the spectral radius is and the total bill for a unit shock is : 2 at , 5 at 0.40, 10 at 0.45, and no finite bill from 0.5 on (Theorem 12.5(iii)). At a unit shock to Digital costs Digital itself 1.9 units, engineering and treasury 1.1 each, and Industrial Systems 0.9; a register of direct exposures books 1.8 of the 5.0 (Online Appendix 12.B.4). Then dampen or cut one arrow and record how far the threshold moves; those results follow from the declarations and are not printed in the book. Last, the dependence audit (Theorem 12.5(iv)): a common cause that fails each of two units with probability 10 percent, on top of 5 percent each on its own, makes both fail with probability 10.2 percent against 2.1 under independence, nearly five times; a common cause of probability can make a joint failure up to times likelier (Online Appendix 12.B.3).
Python Code
idx = {c: i for i, c in enumerate(COMPONENTS)}
A = np.zeros((7, 7)) # A[v, w] = 1 for an arrow w -> v
for u, v, _ in ARROWS:
A[idx[v], idx[u]] = 1
reach = np.linalg.matrix_power(np.eye(7) + A, 6) > 0 # reach[v, w]: w reaches v
mutual = reach & reach.T
core_set = max((frozenset(np.nonzero(mutual[i])[0]) for i in range(7)), key=len)
CORE = [c for c in ("IND", "DIG", "ENG", "TRS") if idx[c] in core_set] # the book's order
ci = [idx[c] for c in CORE]
M = A[np.ix_(ci, ci)]
LEAVING = int(A[np.ix_([i for i in range(7) if i not in ci], ci)].sum())
EIG = np.sort(np.linalg.eigvals(M).real)[::-1]
def distance(src):
# the earliest quarter a shock at src can reach each component: the fewest arrows on a path (Theorem 12.5(i))
d, frontier, k = {src: 0}, {src}, 0
while frontier:
k += 1
frontier = {COMPONENTS[v] for w in frontier for v in np.nonzero(A[:, idx[w]])[0]} - set(d)
d.update({c: k for c in frontier})
return d
DIST_MKT, DIST_DIG = distance("MKT"), distance("DIG")
print(f"the feedback core: {CORE} ({len(core_set)} of {len(COMPONENTS)} components); arrows leaving it: {LEAVING}")
print("the eigenvalues of its wiring:", ", ".join(f"{e + 0.0:g}" for e in np.round(EIG, 9)),
f"; M^3 = 4M: {np.allclose(np.linalg.matrix_power(M, 3), 4 * M)}")
print("a demand shock reaches:", ", ".join(f"{c} in {DIST_MKT[c]}" for c in ("IND", "DIG", "MAT", "TRS")), "quarters")
print("a shock at Digital reaches:", ", ".join(f"{c} in {DIST_DIG[c]}" for c in CORE if c != "DIG"), "quarters")
def bill(g, Mx=M):
# (I - G)^(-1) with G = g Mx: column w is the total impact of a unit shock at w (Theorem 12.5(iii))
return np.linalg.inv(np.eye(len(Mx)) - g * Mx)
D = CORE.index("DIG")
MULT = {g: float(bill(g)[:, D].sum()) for g in (0.25, 0.40, 0.45)}
for g, m in MULT.items():
print(f"g = {g:.2f}: spectral radius of G {g * EIG[0]:.2f}; the total bill of a unit shock {m:.2f} = 1/(1 - 2g)")
B40 = bill(0.40)[:, D]
DIRECT = 1 + 0.40 * M[:, D].sum()
print("g = 0.40, a unit shock at Digital:", ", ".join(f"{c} {b:.3f}" for c, b in zip(CORE, B40)), f"; total {B40.sum():.2f};"
f" a register of direct exposures, I + G, books {DIRECT:.1f}")
l, cum = np.eye(4)[:, D], np.eye(4)[:, D].copy()
print("the walk bound, quarter by quarter (exact transmission, g = 0.40):")
for k in range(1, 7):
l = 0.40 * M @ l; cum += l
print(f" quarter {k}: " + ", ".join(f"{c} {x:.3f}" for c, x in zip(CORE, l)) + f"; cumulative total {cum.sum():.3f}")
for g in (0.50, 0.55):
l, tot = np.eye(4)[:, D], [1.0]
for k in range(40):
l = g * M @ l; tot.append(tot[-1] + l.sum())
print(f"g = {g:.2f}: the cumulative bill after 10, 20 and 40 quarters is {tot[10]:.0f}, {tot[20]:.0f}, {tot[40]:.0f}: no finite bill")
def worst(g, Mx):
# the largest total bill of a unit shock, over the component it strikes
return float(bill(g, Mx).sum(axis=0).max())
VARIANTS = {}
for label, factor in (("one arrow cut", 0.0), ("one arrow halved", 0.5)):
rhos, worsts = [], []
for v, w in zip(*np.nonzero(M)):
Mx = M.copy(); Mx[v, w] = factor
rhos.append(max(abs(np.linalg.eigvals(Mx)))); worsts.append(worst(0.40, Mx))
VARIANTS[label] = (max(rhos), max(worsts), max(rhos) - min(rhos))
M_LINK = M.copy(); M_LINK[CORE.index("DIG"), CORE.index("TRS")] = M_LINK[CORE.index("TRS"), CORE.index("DIG")] = 0.0
VARIANTS["one two-way link cut"] = (max(abs(np.linalg.eigvals(M_LINK))), worst(0.40, M_LINK), 0.0)
print(f"\ndamping and cutting (these follow from the declarations; the core as declared: threshold 0.500, worst bill at 0.40 {worst(0.40, M):.2f})")
for label, (rho, wb, spread) in VARIANTS.items():
print(f" {label:22s}: spectral radius {rho:.4f}, threshold g = {1 / rho:.3f}; the worst bill at g = 0.40 is {wb:.2f}"
+ (f" (every one of the eight arrows alike: spread {spread:.0e})" if "arrow" in label else ""))
def common_cause(z, q_):
m = 1 - (1 - z) * (1 - q_); joint = z + (1 - z) * q_ ** 2
return m, m ** 2, joint, joint / m ** 2
CC = common_cause(0.10, 0.05)
print(f"\nthe dependence audit: a common cause of 10% and separate failures of 5%: each unit fails {CC[0]:.1%};"
f" independence says both {CC[1]:.2%}; truly {CC[2]:.3%}, {CC[3]:.2f} times as likely")
RATIOS = {x: common_cause(0.10, x)[3] for x in (0.05, 0.01, 0.001)}
print(" the ratio for separate failures of 5%, 1% and 0.1%:", ", ".join(f"{r:.2f}" for r in RATIOS.values()),
f"; never more than 1/z = {1 / 0.10:.0f}")
rng = np.random.default_rng(SEED) # fresh draws, lab seed: a million pairs of units
Zc = rng.random(1_000_000) < 0.10
F1, F2 = Zc | (rng.random(1_000_000) < 0.05), Zc | (rng.random(1_000_000) < 0.05)
JF = float((F1 & F2).mean())
print(f" a million fresh pairs (seed {SEED}): each fails {F1.mean():.2%}; both {JF:.2%} +/- {sqrt(JF * (1 - JF) / 1e6):.2%}")
gs = np.linspace(0, 0.62, 621)
fig, ax = plt.subplots(figsize=(7.6, 3.6))
M_CUT, M_HALF = M.copy(), M.copy()
M_CUT[CORE.index("DIG"), CORE.index("TRS")] = 0.0; M_HALF[CORE.index("DIG"), CORE.index("TRS")] = 0.5
for Mx, label, col, ls in ((M, "the core as declared", "#B71C1C", "-"), (M_HALF, "any one arrow halved", "#E65100", "--"),
(M_CUT, "any one arrow cut", "#1F4E79", "-"), (M_LINK, "any one two-way link cut", "#2E7D32", ":")):
rho = max(abs(np.linalg.eigvals(Mx)))
gg = gs[gs * rho < 0.992]
ax.plot(gg, [worst(g, Mx) for g in gg], color=col, lw=1.8, ls=ls, label=f"{label}: threshold {1 / rho:.3f}")
ax.axvline(1 / rho, color=col, lw=0.7, ls=":")
ax.plot(list(MULT), list(MULT.values()), "o", color="#B71C1C", ms=4)
for g, m in MULT.items():
ax.text(g - 0.012, m + 0.35, f"{m:.0f}×", ha="right", va="bottom", fontsize=8, color="#B71C1C")
ax.set(xlabel="gain per arrow, g", ylabel="largest total bill of a unit shock", xlim=(0, 0.62), ylim=(0, 12),
title=f"Cutting any one arrow moves the threshold from 0.50 to {1 / VARIANTS['one arrow cut'][0]:.2f} (seed {SEED})")
ax.legend(frameon=False, fontsize=8, loc="upper left")
plt.tight_layout(); plt.show()the feedback core: ['IND', 'DIG', 'ENG', 'TRS'] (4 of 7 components); arrows leaving it: 0 the eigenvalues of its wiring: 2, 0, 0, -2 ; M^3 = 4M: True a demand shock reaches: IND in 1, DIG in 1, MAT in 1, TRS in 2 quarters a shock at Digital reaches: IND in 2, ENG in 1, TRS in 1 quarters g = 0.25: spectral radius of G 0.50; the total bill of a unit shock 2.00 = 1/(1 - 2g) g = 0.40: spectral radius of G 0.80; the total bill of a unit shock 5.00 = 1/(1 - 2g) g = 0.45: spectral radius of G 0.90; the total bill of a unit shock 10.00 = 1/(1 - 2g) g = 0.40, a unit shock at Digital: IND 0.889, DIG 1.889, ENG 1.111, TRS 1.111 ; total 5.00; a register of direct exposures, I + G, books 1.8 the walk bound, quarter by quarter (exact transmission, g = 0.40): quarter 1: IND 0.000, DIG 0.000, ENG 0.400, TRS 0.400; cumulative total 1.800 quarter 2: IND 0.320, DIG 0.320, ENG 0.000, TRS 0.000; cumulative total 2.440 quarter 3: IND 0.000, DIG 0.000, ENG 0.256, TRS 0.256; cumulative total 2.952 quarter 4: IND 0.205, DIG 0.205, ENG 0.000, TRS 0.000; cumulative total 3.362 quarter 5: IND 0.000, DIG 0.000, ENG 0.164, TRS 0.164; cumulative total 3.689 quarter 6: IND 0.131, DIG 0.131, ENG 0.000, TRS 0.000; cumulative total 3.951 g = 0.50: the cumulative bill after 10, 20 and 40 quarters is 11, 21, 41: no finite bill g = 0.55: the cumulative bill after 10, 20 and 40 quarters is 19, 64, 488: no finite bill damping and cutting (these follow from the declarations; the core as declared: threshold 0.500, worst bill at 0.40 5.00) one arrow cut : spectral radius 1.7321, threshold g = 0.577; the worst bill at g = 0.40 is 3.77 (every one of the eight arrows alike: spread 9e-16) one arrow halved : spectral radius 1.8708, threshold g = 0.535; the worst bill at g = 0.40 is 4.27 (every one of the eight arrows alike: spread 9e-16) one two-way link cut : spectral radius 1.6180, threshold g = 0.618; the worst bill at g = 0.40 is 3.18 the dependence audit: a common cause of 10% and separate failures of 5%: each unit fails 14.5%; independence says both 2.10%; truly 10.225%, 4.86 times as likely the ratio for separate failures of 5%, 1% and 0.1%: 4.86, 8.42, 9.82 ; never more than 1/z = 10 a million fresh pairs (seed 26112): each fails 14.57%; both 10.27% +/- 0.03%

Validation — the book's numbers, and agreement with DCT_V1_Ch12_Lab.xlsx
Each checkpoint is a number printed in Chapter 12 (Worked Example 12.1, Tables 12.1 and 12.6, Sections 12.2–12.7,
Theorems 12.1 and 12.5, Figures 12.1–12.3) or in Online Appendix 12.B. Simulated checkpoints use the book's streams
(seed 8 for the program's paths; seed 12 for Online Appendix 12.B.5). The workbook recomputes the ones marked
workbook with Excel formulas and shows PASS against the same engine values on its Checks sheet.
Python Code
T = {r["name"]: r for r in T126}
checks = [
("two loans: 95% VaR of each (workbook)", VAR1, 0, 0),
("two loans: 95% VaR of the pair (workbook)", VAR2, 100, 0),
("two loans: 95% ES of each (workbook)", ES1, 80, 0.05),
("two loans: 95% ES of the pair (workbook)", ES2, 103.2, 0.05),
("two loans: ES of the parts (workbook)", 2 * ES1, 160, 0.05),
("two loans: P(pair loses nothing) (workbook)", P_NONE, 0.9216, 5e-5),
("two loans: P(pair loses at most 100) (workbook)", P_ATMOST, 0.9984, 5e-5),
("VaR trap at 95%: lowest p (workbook)", WINDOW[0.95][0], 0.025, 5e-4),
("VaR trap at 99%: lowest p (workbook)", WINDOW[0.99][0], 0.005, 5e-4),
("99%, p = 0.008: ES of each (workbook)", E99, 80, 0.05),
("99%, p = 0.008: ES of the pair (workbook)", E99P, 100.6, 0.05),
("cash armor today, $m (workbook)", CASH_ARMOR, 270, 0.5),
("EBITDA, $m (workbook)", EBITDA, 495.6, 0.05),
("net debt, $m (workbook)", NET_DEBT, 1685, 0.5),
("EBITDA at the covenant, $m (workbook)", EBITDA_AT_COVENANT, 374.5, 0.05),
("EBITDA armor, $m (workbook)", EBITDA_ARMOR, 121.1, 0.05),
("EBITDA armor, % (workbook)", 100 * EBITDA_ARMOR / EBITDA, 24.4, 0.05),
("leverage after the floor-breaking loss (workbook)", LEV_AFTER, 3.94, 0.005),
("risk armor today, points (workbook)", RISK_ARMOR, 11, 0),
("scaled slack: liquidity floor (workbook)", SCALED["liquidity floor"], 0.44, 0.005),
("scaled slack: covenant (workbook)", SCALED["covenant"], 0.32, 0.005),
("scaled slack: risk ceiling (workbook)", SCALED["strategic-risk ceiling"], 0.11, 0.005),
("robustness radius today (workbook)", RADIUS, 0.11, 0.005),
("random search: smallest breaking shock (seed 26112)", float(size.min()), 0.11, 0.005),
("worst case: best guaranteed outcome (workbook)", MAXMIN, 4, 0),
("worst case: with foresight (workbook)", MINMAX, 6, 0),
("worst case: expected outcome of A (workbook)", EXPECTED["A, commit the cash to the build"], 8.4, 1e-9),
("worst case: expected outcome of B (workbook)", EXPECTED["B, buy protection first"], 4.4, 1e-9),
("worst case: the premium (workbook)", PREMIUM, 4.0, 1e-9),
("plan armor: gap to OA 12.B.6's row (workbook)", GAP_PLAN, 0, 0),
("phased armor: gap to OA 12.B.6's row (workbook)", GAP_PHASED, 0, 0),
("armor at the low point, $m (workbook)", ARMOR.min(), 132, 0.5),
("quarter of the low point (workbook)", K_LOW, 7, 0),
("armor at the end of the program, $m (workbook)", ARMOR[-1], 160, 0.5),
("armor spent to the low point, $m (workbook)", ARMOR[0] - ARMOR.min(), 138, 0.5),
("armor rebuilt by the end, $m (workbook)", ARMOR[-1] - ARMOR.min(), 28, 0.5),
("quarters below $150m (workbook)", len(THIN), 7, 0),
("first quarter below $150m (workbook)", int(THIN.min()), 4, 0),
("last quarter below $150m (workbook)", int(THIN.max()), 10, 0),
("rebuild after the low point: slowest, $m (workbook)", REBUILD.min(), 2, 0.5),
("phased build: armor at its low point (workbook)", ARMOR_PH.min(), 181, 0.5),
("$150m loss: absorbed today, breaks at the low (workbook)", float(ARMOR[0] > 150 > ARMOR.min()), 1, 0),
("risk armor at the digital peak, points (workbook)", PEAK_ARMOR, 1.4, 0.05),
("month of the risk peak (workbook)", 12 * T_PEAK, 11, 0.5),
("risk armor below a quarter of the error (workbook)", float(PEAK_ARMOR < RISK_ERR / 4), 1, 0),
("scaled risk slack at the peak (workbook)", PEAK_ARMOR / 100, 0.014, 5e-4),
("scaled floor slack at the low point (workbook)", ARMOR.min() / 620, 0.21, 0.005),
("closure size: gamma shape (workbook)", SHAPE, 5.76, 1e-9),
("closure size: gamma scale (workbook)", SCALE_G, 20.8, 0.05),
("closure size: median, $m (workbook)", MED, 113, 0.5),
("closure size: 90th percentile, $m (workbook)", P90, 187, 0.5),
("breach probability, % (seed 8)", 100 * P0, 24.6, 0.05),
("breach depth: mean, $m (seed 8)", DEPTHS.mean(), 72, 0.5),
("breach depth: median, $m (seed 8)", np.median(DEPTHS), 51, 0.5),
("95% VaR of the low point, $m (seed 8)", VAR0, 231, 0.5),
("95% VaR below the floor, $m (seed 8)", FLOOR - VAR0, 119, 0.5),
("95% ES of the low point, $m (seed 8)", ES0, 166, 0.5),
("95% ES below the floor, $m (seed 8)", FLOOR - ES0, 184, 0.5),
("10% quantile of the low point (seed 8)", TAILS[0.90][0], 282, 0.5),
("1% quantile of the low point (seed 8)", TAILS[0.99][0], 127, 0.5),
("90% ES of the low point (seed 8)", TAILS[0.90][1], 213, 0.5),
("99% ES of the low point (seed 8)", TAILS[0.99][1], 66, 0.5),
("revenue: stationary sd, $m (workbook)", SD_INF, 21, 0.05),
("revenue: 90% band, $m (workbook)", BAND, 34.5, 0.05),
("recovery clock to a tenth, quarters (workbook)", K_EPS, 7, 0),
("back inside the band, quarters (workbook)", K_BAND, 2.7, 0.05),
("first quarter inside the band (workbook)", K_IN, 3, 0),
("within $1m of plan, % of quarters (workbook)", 100 * P_NEAR, 3.8, 0.05),
("stressed equilibrium, $m (workbook)", EQ, -50, 1e-9),
("stress multiplier (workbook)", 1 / (1 - A_R), 3.3, 0.05),
("A heals a shock of 0.5 (workbook)", HEAL[("A", 0.5)], 1.2, 0.05),
("B heals a shock of 0.5 (workbook)", HEAL[("B", 0.5)], 11.5, 0.05),
("B heals a shock of 5 (workbook)", HEAL[("B", 5.0)], 23, 0.05),
("a shock of 5 ends A's regime (workbook)", float(HEAL[("A", 5.0)] is None), 1, 0),
("A heals ten times faster (workbook)", HEAL[("B", 0.5)] / HEAL[("A", 0.5)], 10, 1e-9),
("race: intervention during recovery, % (workbook)", 100 * RACE_REG, 23, 0.5),
("interventions: mean wait, years (workbook)", 1 / LAM_REG, 6.7, 0.05),
("race: closure in the thin window (workbook)", RACE_THIN, 0.161, 5e-4),
("closure exceeds the low point's armor, % (workbook)", 100 * P_EXCEED_LOW, 36, 0.5),
("ratchet: one median closure survived (workbook)", float(MED < ARMOR.min()), 1, 0),
("ratchet: two exceed the armor from q1 on (workbook)", float(2 * MED > ARMOR[1:].max()), 1, 0),
("survival product: breach odds, % (seed 8; workbook)", 100 * (1 - SURV[-1]), 24.6, 0.05),
("revenue: a quarter below -45, % (workbook)", 100 * P1Q, 1.6, 0.05),
("Boole's floor, twelve quarters, % (workbook)", 1200 * P1Q, 19.3, 0.05),
("Boole's floor, four quarters, % (workbook)", 400 * P1Q, 6.4, 0.05),
("simulated, twelve quarters, % (seed 12)", 100 * SIM12, 12.4, 0.05),
("simulated, four quarters, % (seed 12)", 100 * SIM4, 4.9, 0.05),
] + [
(f"Table 12.6, {name.lower()}: armor covered, $m (workbook)", T[name]["armor"] + T[name]["line"], want, 0.5)
for name, want in (("Plan as designed", 132), ("Standby line", 232), ("Phased build", 181), ("Both levers", 281))
] + [
(f"Table 12.6, {name.lower()}: closure exceeds it, % (workbook)", 100 * T[name]["exceed"], want, tol)
for name, want, tol in (("Plan as designed", 36, 0.5), ("Standby line", 2.8, 0.05), ("Phased build", 12, 0.5),
("Both levers", 0.6, 0.05))
] + [
(f"Table 12.6, {name.lower()}: breach, % (seed 8)", 100 * T[name]["p"], want, 0.05)
for name, want in (("Plan as designed", 24.6), ("Standby line", 12.4), ("Phased build", 13.1), ("Both levers", 3.0))
] + [
(f"Table 12.6, {name.lower()}: 95% VaR, $m (seed 8)", T[name]["var"], want, 0.5)
for name, want in (("Plan as designed", 231), ("Standby line", 320), ("Phased build", 278), ("Both levers", 367))
] + [
(f"Table 12.6, {name.lower()}: 95% ES, $m (seed 8)", T[name]["es"], want, 0.5)
for name, want in (("Plan as designed", 166), ("Standby line", 286), ("Phased build", 213), ("Both levers", 332))
] + [
("Table 12.6: largest standard error, points (workbook)", 100 * max(r["se"] for r in T126), 0.14, 0.005),
("both levers: VaR above the floor, $m (seed 8)", BOTH["var"] - FLOOR, 17, 0.5),
("both levers: ES below the floor, $m (seed 8)", FLOOR - BOTH["es"], 18, 0.5),
("core: components", len(CORE), 4, 0),
("core: arrows leaving it", LEAVING, 0, 0),
("core: spectral radius of the wiring (workbook)", EIG[0], 2, 1e-9),
("core: eigenvalues 2, 0, 0, -2", float(np.abs(EIG - [2, 0, 0, -2]).max()), 0, 1e-9),
("demand shock reaches the divisions, quarters", max(DIST_MKT[c] for c in ("IND", "DIG", "MAT")), 1, 0),
("demand shock reaches treasury, quarters", DIST_MKT["TRS"], 2, 0),
("Digital's shock reaches ENG and TRS, quarters (workbook)", max(DIST_DIG["ENG"], DIST_DIG["TRS"]), 1, 0),
("Digital's shock reaches IND, quarters (workbook)", DIST_DIG["IND"], 2, 0),
("multiplier at g = 0.25 (workbook)", MULT[0.25], 2, 1e-9),
("multiplier at g = 0.40 (workbook)", MULT[0.40], 5, 1e-9),
("multiplier at g = 0.45 (workbook)", MULT[0.45], 10, 1e-9),
("threshold gain (workbook)", 1 / EIG[0], 0.5, 1e-9),
("g = 0.40: Digital's own bill (workbook)", B40[CORE.index("DIG")], 1.9, 0.05),
("g = 0.40: engineering's bill (workbook)", B40[CORE.index("ENG")], 1.1, 0.05),
("g = 0.40: treasury's bill (workbook)", B40[CORE.index("TRS")], 1.1, 0.05),
("g = 0.40: Industrial Systems' bill (workbook)", B40[CORE.index("IND")], 0.9, 0.05),
("g = 0.40: direct exposures I + G (workbook)", DIRECT, 1.8, 1e-9),
("common cause: each unit fails, % (workbook)", 100 * CC[0], 14.5, 0.05),
("common cause: independence, % (workbook)", 100 * CC[1], 2.1, 0.05),
("common cause: both fail, % (workbook)", 100 * CC[2], 10.2, 0.05),
("common cause: times as likely (workbook)", CC[3], 4.9, 0.05),
("common cause: ratio at q = 1% (workbook)", RATIOS[0.01], 8.4, 0.05),
("common cause: bound 1/z (workbook)", 1 / 0.10, 10, 1e-9),
]
ok, width = 0, max(len(name) for name, *_ in checks)
for name, got, want, tol in checks:
status = "PASS" if abs(got - want) <= tol + 1e-9 else "FAIL"; ok += status == "PASS"
f = ".6f" if abs(want) < 1 else ".4f"
print(f"{name:{width}s} {got:13{f}} book {want:11{f}} {status}")
print(f"\n{ok} of {len(checks)} checkpoints PASS")two loans: 95% VaR of each (workbook) 0.000000 book 0.000000 PASS two loans: 95% VaR of the pair (workbook) 100.0000 book 100.0000 PASS two loans: 95% ES of each (workbook) 80.0000 book 80.0000 PASS two loans: 95% ES of the pair (workbook) 103.2000 book 103.2000 PASS two loans: ES of the parts (workbook) 160.0000 book 160.0000 PASS two loans: P(pair loses nothing) (workbook) 0.921600 book 0.921600 PASS two loans: P(pair loses at most 100) (workbook) 0.998400 book 0.998400 PASS VaR trap at 95%: lowest p (workbook) 0.025321 book 0.025000 PASS VaR trap at 99%: lowest p (workbook) 0.005013 book 0.005000 PASS 99%, p = 0.008: ES of each (workbook) 80.0000 book 80.0000 PASS 99%, p = 0.008: ES of the pair (workbook) 100.6400 book 100.6000 PASS cash armor today, $m (workbook) 270.0000 book 270.0000 PASS EBITDA, $m (workbook) 495.6000 book 495.6000 PASS net debt, $m (workbook) 1685.0400 book 1685.0000 PASS EBITDA at the covenant, $m (workbook) 374.4533 book 374.5000 PASS EBITDA armor, $m (workbook) 121.1467 book 121.1000 PASS EBITDA armor, % (workbook) 24.4444 book 24.4000 PASS leverage after the floor-breaking loss (workbook) 3.9448 book 3.9400 PASS risk armor today, points (workbook) 11.0000 book 11.0000 PASS scaled slack: liquidity floor (workbook) 0.435484 book 0.440000 PASS scaled slack: covenant (workbook) 0.323529 book 0.320000 PASS scaled slack: risk ceiling (workbook) 0.110000 book 0.110000 PASS robustness radius today (workbook) 0.110000 book 0.110000 PASS random search: smallest breaking shock (seed 26112) 0.110000 book 0.110000 PASS worst case: best guaranteed outcome (workbook) 4.0000 book 4.0000 PASS worst case: with foresight (workbook) 6.0000 book 6.0000 PASS worst case: expected outcome of A (workbook) 8.4000 book 8.4000 PASS worst case: expected outcome of B (workbook) 4.4000 book 4.4000 PASS worst case: the premium (workbook) 4.0000 book 4.0000 PASS plan armor: gap to OA 12.B.6's row (workbook) 0.000000 book 0.000000 PASS phased armor: gap to OA 12.B.6's row (workbook) 0.000000 book 0.000000 PASS armor at the low point, $m (workbook) 131.9504 book 132.0000 PASS quarter of the low point (workbook) 7.0000 book 7.0000 PASS armor at the end of the program, $m (workbook) 160.4240 book 160.0000 PASS armor spent to the low point, $m (workbook) 138.0496 book 138.0000 PASS armor rebuilt by the end, $m (workbook) 28.4737 book 28.0000 PASS quarters below $150m (workbook) 7.0000 book 7.0000 PASS first quarter below $150m (workbook) 4.0000 book 4.0000 PASS last quarter below $150m (workbook) 10.0000 book 10.0000 PASS rebuild after the low point: slowest, $m (workbook) 1.9037 book 2.0000 PASS phased build: armor at its low point (workbook) 180.9739 book 181.0000 PASS $150m loss: absorbed today, breaks at the low (workbook) 1.0000 book 1.0000 PASS risk armor at the digital peak, points (workbook) 1.4475 book 1.4000 PASS month of the risk peak (workbook) 10.8960 book 11.0000 PASS risk armor below a quarter of the error (workbook) 1.0000 book 1.0000 PASS scaled risk slack at the peak (workbook) 0.014475 book 0.014000 PASS scaled floor slack at the low point (workbook) 0.212823 book 0.210000 PASS closure size: gamma shape (workbook) 5.7600 book 5.7600 PASS closure size: gamma scale (workbook) 20.8333 book 20.8000 PASS closure size: median, $m (workbook) 113.1316 book 113.0000 PASS closure size: 90th percentile, $m (workbook) 186.8670 book 187.0000 PASS breach probability, % (seed 8) 24.6220 book 24.6000 PASS breach depth: mean, $m (seed 8) 72.4472 book 72.0000 PASS breach depth: median, $m (seed 8) 51.4583 book 51.0000 PASS 95% VaR of the low point, $m (seed 8) 231.2699 book 231.0000 PASS 95% VaR below the floor, $m (seed 8) 118.7301 book 119.0000 PASS 95% ES of the low point, $m (seed 8) 166.3278 book 166.0000 PASS 95% ES below the floor, $m (seed 8) 183.6722 book 184.0000 PASS 10% quantile of the low point (seed 8) 282.0434 book 282.0000 PASS 1% quantile of the low point (seed 8) 127.3656 book 127.0000 PASS 90% ES of the low point (seed 8) 212.6528 book 213.0000 PASS 99% ES of the low point (seed 8) 66.2187 book 66.0000 PASS revenue: stationary sd, $m (workbook) 21.0042 book 21.0000 PASS revenue: 90% band, $m (workbook) 34.5488 book 34.5000 PASS recovery clock to a tenth, quarters (workbook) 7.0000 book 7.0000 PASS back inside the band, quarters (workbook) 2.6843 book 2.7000 PASS first quarter inside the band (workbook) 3.0000 book 3.0000 PASS within $1m of plan, % of quarters (workbook) 3.7973 book 3.8000 PASS stressed equilibrium, $m (workbook) -50.0000 book -50.0000 PASS stress multiplier (workbook) 3.3333 book 3.3000 PASS A heals a shock of 0.5 (workbook) 1.1513 book 1.2000 PASS B heals a shock of 0.5 (workbook) 11.5129 book 11.5000 PASS B heals a shock of 5 (workbook) 23.0259 book 23.0000 PASS a shock of 5 ends A's regime (workbook) 1.0000 book 1.0000 PASS A heals ten times faster (workbook) 10.0000 book 10.0000 PASS race: intervention during recovery, % (workbook) 23.0874 book 23.0000 PASS interventions: mean wait, years (workbook) 6.6667 book 6.7000 PASS race: closure in the thin window (workbook) 0.160543 book 0.161000 PASS closure exceeds the low point's armor, % (workbook) 35.5755 book 36.0000 PASS ratchet: one median closure survived (workbook) 1.0000 book 1.0000 PASS ratchet: two exceed the armor from q1 on (workbook) 1.0000 book 1.0000 PASS survival product: breach odds, % (seed 8; workbook) 24.6220 book 24.6000 PASS revenue: a quarter below -45, % (workbook) 1.6080 book 1.6000 PASS Boole's floor, twelve quarters, % (workbook) 19.2954 book 19.3000 PASS Boole's floor, four quarters, % (workbook) 6.4318 book 6.4000 PASS simulated, twelve quarters, % (seed 12) 12.3510 book 12.4000 PASS simulated, four quarters, % (seed 12) 4.8505 book 4.9000 PASS Table 12.6, plan as designed: armor covered, $m (workbook) 131.9504 book 132.0000 PASS Table 12.6, standby line: armor covered, $m (workbook) 231.9504 book 232.0000 PASS Table 12.6, phased build: armor covered, $m (workbook) 180.9739 book 181.0000 PASS Table 12.6, both levers: armor covered, $m (workbook) 280.9739 book 281.0000 PASS Table 12.6, plan as designed: closure exceeds it, % (workbook) 35.5755 book 36.0000 PASS Table 12.6, standby line: closure exceeds it, % (workbook) 2.8242 book 2.8000 PASS Table 12.6, phased build: closure exceeds it, % (workbook) 11.6461 book 12.0000 PASS Table 12.6, both levers: closure exceeds it, % (workbook) 0.611020 book 0.600000 PASS Table 12.6, plan as designed: breach, % (seed 8) 24.6220 book 24.6000 PASS Table 12.6, standby line: breach, % (seed 8) 12.3740 book 12.4000 PASS Table 12.6, phased build: breach, % (seed 8) 13.0680 book 13.1000 PASS Table 12.6, both levers: breach, % (seed 8) 3.0030 book 3.0000 PASS Table 12.6, plan as designed: 95% VaR, $m (seed 8) 231.2699 book 231.0000 PASS Table 12.6, standby line: 95% VaR, $m (seed 8) 319.7214 book 320.0000 PASS Table 12.6, phased build: 95% VaR, $m (seed 8) 278.0759 book 278.0000 PASS Table 12.6, both levers: 95% VaR, $m (seed 8) 366.6378 book 367.0000 PASS Table 12.6, plan as designed: 95% ES, $m (seed 8) 166.3278 book 166.0000 PASS Table 12.6, standby line: 95% ES, $m (seed 8) 285.5516 book 286.0000 PASS Table 12.6, phased build: 95% ES, $m (seed 8) 213.3775 book 213.0000 PASS Table 12.6, both levers: 95% ES, $m (seed 8) 332.4679 book 332.0000 PASS Table 12.6: largest standard error, points (workbook) 0.136234 book 0.140000 PASS both levers: VaR above the floor, $m (seed 8) 16.6378 book 17.0000 PASS both levers: ES below the floor, $m (seed 8) 17.5321 book 18.0000 PASS core: components 4.0000 book 4.0000 PASS core: arrows leaving it 0.000000 book 0.000000 PASS core: spectral radius of the wiring (workbook) 2.0000 book 2.0000 PASS core: eigenvalues 2, 0, 0, -2 0.000000 book 0.000000 PASS demand shock reaches the divisions, quarters 1.0000 book 1.0000 PASS demand shock reaches treasury, quarters 2.0000 book 2.0000 PASS Digital's shock reaches ENG and TRS, quarters (workbook) 1.0000 book 1.0000 PASS Digital's shock reaches IND, quarters (workbook) 2.0000 book 2.0000 PASS multiplier at g = 0.25 (workbook) 2.0000 book 2.0000 PASS multiplier at g = 0.40 (workbook) 5.0000 book 5.0000 PASS multiplier at g = 0.45 (workbook) 10.0000 book 10.0000 PASS threshold gain (workbook) 0.500000 book 0.500000 PASS g = 0.40: Digital's own bill (workbook) 1.8889 book 1.9000 PASS g = 0.40: engineering's bill (workbook) 1.1111 book 1.1000 PASS g = 0.40: treasury's bill (workbook) 1.1111 book 1.1000 PASS g = 0.40: Industrial Systems' bill (workbook) 0.888889 book 0.900000 PASS g = 0.40: direct exposures I + G (workbook) 1.8000 book 1.8000 PASS common cause: each unit fails, % (workbook) 14.5000 book 14.5000 PASS common cause: independence, % (workbook) 2.1025 book 2.1000 PASS common cause: both fail, % (workbook) 10.2250 book 10.2000 PASS common cause: times as likely (workbook) 4.8633 book 4.9000 PASS common cause: ratio at q = 1% (workbook) 8.4244 book 8.4000 PASS common cause: bound 1/z (workbook) 10.0000 book 10.0000 PASS 133 of 133 checkpoints PASS
Next. Chapter 13 assembles Part III's four structures, with the transformation layer of Chapters 6–8 as the dynamic element they share, into the Unified Enterprise Transformation Architecture: one state, five layers, and a declared register of the couplings between them. Every layer can pass its own stress test while the whole is unstable, and on the same digital program the joint check finds $325 million of claims on $270 million of cash. AXIOM-12 runs this chapter's model interactively (Lab 1.12); this notebook and the workbook are its reproducible record.


