Engine self-test

Mathematical invariant battery for the APEX v10 Forward-Return Engine. Each check tests a property the math must hold — graceful degradation under missing data, monotone variance growth, distribution percentile ordering, multiplier symmetry, etc. Runs live every page load.

Result
All 14 invariants hold
Passed
14 / 14
neutral z → drift only
Score 50 (z=0) makes alpha contribution zero → mean equals horizon-scaled market drift exactly.
Expected:0.011910 (drift only)Got:0.011910
max bullish bounded
Perfect bullish setup (score 100, risk_on, bullish pattern at delta=12, tail-aligned, max confidence) yields 90d expected return between 7% and 13% (reasonable upper bound).
Expected:[+7%, +13%] / 90dGot:10.32% / 90d
bull/bear alpha symmetric
Maximum bullish alpha (score=100, perfect setup) and maximum bearish alpha (score=0, perfect setup) should be opposite-signed mirror images.
Expected:bullAlpha == -bearAlphaGot:bullAlpha=0.06750, bearAlpha=-0.06750
variance always > 0
Even with maximum confidence and tightest interval, variance never collapses to zero — we never claim more certainty than market base.
Expected:std > 0 for all horizonsGot:0.00596, 0.01578, 0.03266, 0.05657
P(positive) ∈ [0, 1]
Probability outputs are always valid probabilities — no leakage above 1 or below 0 across any input combination.
Expected:0 ≤ P ≤ 1Got:all valid
mean inside 90% CI
Central estimate (mean) always sits inside the 90% confidence interval — basic Gaussian invariant.
Expected:ci90Low ≤ mean ≤ ci90HighGot:all horizons OK
bear ≤ base ≤ bull
Distribution percentiles are monotonically ordered (25th ≤ 50th ≤ 75th).
Expected:bearCase ≤ baseCase ≤ bullCaseGot:monotone
missing regime → defaults to transition
Inputs without explicit regime degrade to the transition multiplier (most conservative default).
Expected:same multiplier as transitionGot:withRegime=0.85, without=0.85
no pattern → mult = 1.0
Pattern multiplier neutralises to 1.0 when no pattern fires (graceful degradation).
Expected:1.00Got:1.0000
no tail data → mult = 1.0
Tail amplifier neutralises to 1.0 when no tail-dependence data available.
Expected:1.00Got:1.0000
wider interval → wider std
Conformal interval width inflates variance monotonically — wider band, more uncertainty.
Expected:wideStd > tightStdGot:tight=0.04195, wide=0.06565
verdict modulates regime amplifier
Bearish verdict in risk-off regime amplifies more strongly than bullish verdict in risk-off — verdict aligns with regime expectation.
Expected:A[bearish][risk_off] > A[bullish][risk_off]Got:bearish=1.3, bullish=0.6
|mean| grows with horizon
On a strong directional setup, expected return magnitude grows monotonically with horizon (square-root-time alpha + linear drift).
Expected:|μ_1d| < |μ_7d| < |μ_30d| < |μ_90d|Got:0.31% < 1.00% < 2.69% < 6.17%
TSM-like mid-tier setup
Score 71 / bullish / transition / pattern +7 / tail 0.18 / conf 72 / interval [56,82]: 30d mean should land in [+0.5%, +4%] and P(positive) in [50%, 85%].
Expected:mean ∈ [+0.5%, +4%], P(pos) ∈ [50%, 85%]Got:mean=2.10%, P(pos)=67%

What this proves. If all checks pass, the engine satisfies its mathematical invariants — graceful degradation, monotone variance, valid probabilities, symmetric responses to symmetric inputs. This is necessary but not sufficient: the formula is internally consistent, but real-world predictive accuracy requires forward returns, which calibrate after 2026-05-16. See methodology for the full math, track record for empirical performance once measured.

Run at 26 Apr 2026, 01:10:10