Prediction Model Overview
All quantitative prediction systems in MI-OS XUANJI | 28 engines across 7 categories
MC Factor Model
SCPM / Supply Chain
Geopolitical
Credit / Risk
Housing / Regional
Valuation / DCF
1. MC Factor Models (18 models)
Ridge regression on 20yr monthly data + Newey-West HAC + residual bootstrap 20K simulations. FX Dashboard
Methodology: OOS R2 = rolling 60/40 out-of-sample validation. Factor stability = coefficient sign must not flip between data halves. See docs/MC_Prediction_Engine.md for full causal maps + failed experiments.
2. SCPM — Supply Chain Propagation Model
Per-industry 3-variable cycle model: L1 (Leading) + O (Operating) + R (Risk). 28+ industry configs.
SCPM Cycle Phase ACTIVE
Composite score [-6, +6] maps to 6 phases: TROUGH / EARLY_RECOVERY / MID_CYCLE / LATE_CYCLE / PEAK / DOWNTURN
L1 (Physical Lag, 3-9M lead)
SOX momentum + monthly revenue YoY + FRED orders
O (Order/Inventory)
Inventory days z-score + pass-through ratio + capex/depreciation
R (Risk/Regressor)
HY spread + VIX + yield curve + NFCI
28+ industriesA/B/W/C data tiersCalibrated per-industry thresholds
SCPM Z-Score Predictions ACTIVE
Statistical anomaly detection: when any SCPM indicator exceeds 2-sigma → generate directional prediction
Indicator z-score > 2.0 → prediction (direction + magnitude from historical distribution)
Per-tickerQuantitative basis
SC Contagion Engine ACTIVE
Supply chain risk propagation. N-hop decay model through verified SC edges.
Score shock at Node A
→ 50% decay per hop (regime-coupled)
→ STAGFLATION: 35% decay (wider)
→ GOLDILOCKS: 55% decay (contained)
→ Max 4 hops
936 SC edgesRegime-coupled decay
SC Lead-Lag Prediction ACTIVE
Upstream revenue changes predict downstream margins (3-6M lag). Based on verified supply chain relationships.
Upstream RevG change → 3-6M → Downstream margin impact
Dampening: upstream=0.6, downstream=0.4 (auto-tuned)
Per-template MAE guard8 tunable parameters
3. Macro Regime & Path Detection
4-regime classification + Bayesian 4-path probability + 18-year cycle + dollar cycle.
Macro Regime Classifier ACTIVE
4 regimes: GOLDILOCKS / REFLATION / STAGFLATION / DEFLATION. SFI (Systemic Fragility Index) = VIX(30%) + HY(30%) + YC(20%) + ISM(20%)
Leading indicators → SFI → Regime classification
Growth signal (ISM, employment) × Inflation signal (CPI, PPI, breakeven)
→ 2×2 matrix → regime
macro_regime.pyReal-time
Bayesian Path Detection (10 signals) ACTIVE
4 paths: A (Goldilocks) / B (Reflation) / C (Stagflation) / D (Hard Landing). Bayesian posterior updating.
Prior P(path) × L(data|path) for 10 signals:
S1: Yield curve S2: Claims S3: HY spread S4: Breakeven
S5: NFCI S6: Bank lending S7: Dual YC inversion
S8: Exogenous shocks (oil/tariff/geo/SC)
S9: Dollar cycle 18yr phase + dedollarization
→ Normalize → Dominant path + confidence
detect_paths()10 Bayesian signals
Dollar Cycle (18yr + Chokepoint) ACTIVE
Patel 18yr cycle + He Si-Yin chokepoint framework. Current: Year 16/18, WEAKENING phase.
18yr Phase: RECOVERY→EXPANSION→BOOM→FRENZY→CRISIS
Dollar Phase: EARLY_STRENGTH→PEAK→WEAKENING→TROUGH
Dedollarization: 5-layer monitor (SWIFT/reserves/gold/CNY/BRICS)
Chokepoint Risk: SWIFT dependency + USD exposure + sanctions proximity
dollar_cycle.py4 sub-modules
Macro Prediction Arbiter ACTIVE
Cross-module arbitration: normalizes tickers, removes stale/buggy predictions, picks canonical view when modules disagree.
macro_prediction_arbiter.pyBronze→Silver→Gold
4. Geopolitical Models
Decision trees + path forecasts + constraint-based analysis. Bridges qualitative → quantitative.
Geo Decision Trees ACTIVE
Per-issue branching with probability-weighted outcomes. E.g., GEO-002 (Taiwan Strait): 3 branches with per-ticker quantitative impact.
Issue state → Branches (3-5 paths)
Each branch: probability + per-ticker direction/range + mechanism
→ unified_context.derived_impacts → ticker-level predictions
geo_fill_decision_trees.py15+ active issues
Geo Path × Macro Matrix ACTIVE
Macro implications by quarter per geopolitical path. Conditional probability evolution over time.
GEO issue × Path → Fed / GDP / CPI / Oil / FX targets by quarter
Event checkpoints with probability updates
geo_path_forecast.pySQLite Silver/Gold
Geo Asset Allocation ACTIVE
MC-calibrated BUY/HOLD/SELL for SPX/TW50/GLD/TLT. Rule-based (not LLM).
MC model expected return + CI
→ P(>8%) → BUY, P(<-8%) → SELL, else HOLD
+ Regime override (STAGFLATION → force HOLD equities)
geo_asset_models.py4 assets
Broadmarket Price Verification ACTIVE
L1 price hook batch verification: predicted vs actual market data → market_regime_signal (risk_off/risk_on/stagflation).
geo_verify.pyReal-time verification
5. Valuation & Financial Models
DCF 3-stage + Reverse DCF + Sensitivity + Monte Carlo simulation.
DCF 3-Stage Valuation ACTIVE
calc_engine.dcf_3stage(): Explicit forecast → fade → terminal. Template-aware WACC.
FCF base × g1 (5yr) × g2 (fade) × g3 (terminal)
÷ WACC → NPV → per-share fair value
Gap > 15% → prediction candidate
calc_engine.py663 cached valuations
Reverse DCF ACTIVE
Implied growth rate from market price. Identifies what the market is "pricing in".
sensitivity_engine.pyMispricing detection
MC Scenario Simulation ACTIVE
10K paths for revenue, score, portfolio returns, SC contagion. Percentile distribution output.
Revenue paths: mean-reverting growth noise (3yr)
Score evolution: probabilistic changes
Portfolio: multi-asset correlated scenarios
SC contagion: propagation probability
xj_monte_carlo.pyp10/p25/p50/p75/p90
Capital Cycle Stage ACTIVE
5-stage detection: CC1 (Recovery) → CC2 (Expansion) → CC3 (Peak) → CC4 (Downturn) → CC5 (Trough)
RevG + Capex/Deprec + P/B + Utilization → Stage
Eligible: Cyclical/Energy/Semi/Industrial/Hardware templates
cc_stage_detector.pyPortfolio Model B gate
6. Credit, Housing & Commodity
CRS credit scoring + housing regional forecast + commodity cobweb models.
CRS Credit Risk Score ACTIVE
7-dimension score: ICR(25%) + Leverage(25%) + Current(20%) + CCC(15%) + AltmanZ(15%) + Profitability + Scale
Financial data → 7 piecewise-linear subscores
→ Weighted composite → Rating (AAA to CC)
→ TCRI 1-9+D mapping for bank comparability
crs_engine.pyS&P/Moody's calibrated
Housing Price Forecast v2.4 ACTIVE
22 regions × 3 scenarios × 20 quarters. 6 models: Credit cycle + Stock-flow + Affordability + Demographic + TSMC multiplier + Policy regime.
Credit cycle (Mian-Sufi + Patel feedback)
Stock-flow (permits → supply → 2026 交屋潮)
Affordability constraint (PIR ceiling)
Demographic (household formation)
TSMC multiplier (fab investment shock)
Policy regime (CBC + 囤房稅 + 新青安)
housing_forecast.py22 regions, 5yr horizon
Commodity Driver Model ACTIVE
Cobweb cycle + cost pass-through for commodity-driven companies. Edible oil, steel, energy, metals, shipping.
Commodity futures price → Cobweb production lag (1-3Q)
→ Cost pass-through → Margin prediction
→ Revenue/Earnings impact by ticker
commodity_drivers.py6 commodity categories
FX Constraint Models ACTIVE
Impossible Trinity framework for managed currencies: CNY (PBOC band), HKD (peg), SGD (NEER basket).
CNY: rate_diff + VIX + oil + DXY → depreciation signals
Hard ceiling 7.5 / floor 6.5 / daily ±2%
HKD: Pegged 7.75-7.85 → HKD/TWD ≈ USD/TWD
SGD: MAS NEER target → partially predictable
fx_constraint_models.py3 currencies
7. Meta & Quality Systems
Divergence detection, game theory, thinking models, prediction quality gates.
Divergence Engine (12 types) ACTIVE
Detects disagreements between XUANJI signals and market consensus. Smart/Dumb money classification.
D1: Earnings vs SC D2: Insider vs Score D3: SCPM vs Fund Flow
D4: Module introspection D5: Analyst vs Score D6: Macro vs Sector
D7: Sentiment vs Score D8: Contagion vs Price D9: Smart vs Dumb
D10: 18yr vs Consensus D11: Dollar structural D12: Dedollarization
divergence_engine.py12 divergence types
Game Theory Engine ACTIVE
3-agent competitive simulation: Client strategist vs Primary competitor vs Regulatory environment. Response: MATCH / UNDERCUT / DIFFERENTIATE / IGNORE.
game_theory_engine.pyConsulting reports
Thinking Model Auto-Learning ACTIVE
Extract reusable frameworks from articles → A/B test via predictions → promote if +5% hit rate.
CANDIDATE → VALIDATED → PROMOTED → RETIRED
43 active thinking models, 118 books integrated
thinking_model.py43 TMs active
Prediction Quality Gates (N19-N29) ACTIVE
N19: quality gate (universe + direction + deadline). N19o: rubber-stamp detection. N19p: NOWCAST/FORECAST classification. N19q: narrative vs model-backed.
xj_predict.py11 gates
MC Factor Model Detail
Full methodology: docs/MC_Prediction_Engine.md