Guards (declare once; use-unless-you-know-better).
eps_a = 1e-6 # alignment clamp; apply before any atanh
eps_w = 1e-12 # denominator guard when pooling; if used
R2_min = 0.85 # real-data fit quality floor
delta_score = 2.0 # tie-band for model scores
K = 5 # tail windows to summarize (K >= 3 acceptable)
tol_p = 1e-2 # exponent tolerance
tol_m = 1e-3 # finite-ratio tolerance
tol_0 = 1e-3 # zero tolerance
M_large = 1e3 # infinity threshold (tail)
eta_mono = 0.01 # monotone-growth slack on tail
Tail statistics (windowed near x0). For nested windows {W_r} shrinking to x0 and any scalar series u:
median_by_window(u)_r := median( { u(t) : t in W_r } )
median_tail(u) := median( median_by_window(u)_{R-K+1..R} )
var_tail(u) := variance( median_by_window(u)_{R-K+1..R} )
monotone_up(u) := true iff for j = R-K+1..R-1:
median_by_window(u)_{j+1} >= median_by_window(u)_{j} * (1 - eta_mono)
AT0 — same-window comparability.
Pass if f and g are evaluated on identical x-samples in each tail window (left/right handled separately).
Fail -> set REG = MULTI (and re-run fits on matched samples if available).
AT1 — rate identification.
For each h in {f,g}, let p_hat_h be slope from log|h| vs log|x - x0|.
- Synthetic: pass if
|p_hat_h - p_h| <= tol_pand, if logs present,|q_hat_h - q_h| <= tol_p. - Real data: pass if
R2_h >= R2_minon the chosen lens.
AT2 — magnitude regime (tail checks).
FINITE: median_tail( | f/g - c_f/c_g | ) <= tol_m
ZERO: median_tail( | f/g | ) <= tol_0
INF: median_tail( | f/g | ) >= M_large AND monotone_up( | f/g | )
DIR (INF): majority sign on tail must match sign(c_f/c_g),
else REG = SIDED (if split by side) or REG = MULTI (if mixed)
AT3 — alignment determinacy.
a_f := clamp(a_f, -1+eps_a, +1-eps_a)
a_g := clamp(a_g, -1+eps_a, +1-eps_a)
a_div := tanh( atanh(a_f) - atanh(a_g) )
Pass if |a_div| < 1 - eps_a # alignment is metadata; must remain strictly bounded
AT4 — collapse parity.
phi(< m_out , a_div >) = m_out_class
Pass if the headline class (ZERO / FINITE / INF±) matches the classical dominant-term decision from (Delta_p, Delta_q) (sign via sign(c_f/c_g) for INF).
AT5 — sidedness (mandatory for real data).
Run the full pipeline on x -> x0- and x -> x0+.
- Pass if classes (and DIR for INF) agree.
- If they differ, set
REG = SIDEDand print both one-sided results.
AT6 — oscillation (mandatory for real data).
If var_tail(f/g) does not shrink and/or signs alternate persistently on the tail, set REG = OSC and avoid a single VAL[.].
Pass if the oscillation condition is correctly detected and flagged.
AT7 — window invariance (stability).
Refit with halved and doubled outer radii (same K), recompute (p_f,q_f) and (p_g,q_g), and reclassify.
Pass if headline unchanged AND
|Delta_p(new) - Delta_p(old)| <= tol_p AND
|Delta_q(new) - Delta_q(old)| <= tol_p
Else -> prefer conservative headline (ZERO < FINITE < INF) and set REG = MULTI
AT8 — model ambiguity (tie-band enforcement).
Within each side, if >=2 families have scores within delta_score, mark REG = MULTI.
- Headline must use conservative order
ZERO < FINITE < INF. - Optional: list family one-liners with scores for audit.
Failure and fallback policy (ladder).
If AT1 fails on all lenses -> REG = MULTI (NOFIT) or REG = OSC (if AT6)
If AT2 cannot certify regime -> conservative headline + REG = MULTI
Alignment (AT3) never changes headline magnitude
If DIR for INF is unstable -> prefer REG = SIDED (if sided) else REG = MULTI
Navigation
Prev: Classifying 0over0 Limits — Practitioner Pipeline (step-by-step) (5)
Next: Classifying 0over0 Limits — Acceptance Tests — Sensitivity to estimation error (6A)