Quantitative Research Prototype

Binary state encoding
for market regime
detection

The 16-state Fâ geomantic system — a structured combinatorial space — reinterpreted as a discrete 4-bit categorical variable. Evaluated against Gaussian hidden Markov regime models, CUSUM volatility breakpoints, and walk-forward information coefficient validation.

No a priori causal claim. Each figure is a categorical market state. The question is purely empirical: does this encoding carry statistically significant information?

16 binary states — click any figure

● = bit 1   ●● = bit 0

MSB (Bit 3) = macro trend · LSB (Bit 0) = momentum

Primary finding

IC = −0.10

Spearman ρ at 5-day horizon

Statistical test

p = 0.03

Permutation test, n = 1,000 — H₀ rejected

Signal interpretation

Contrarian

Negative IC → mean-reversion encoding, not momentum

Research question

Does a 4-bit categorical market-structure encoder derived from the Fâ geomantic combinatorial system carry statistically significant predictive information, improve hidden Markov model regime labelling, or detect volatility regimes beyond standard technical indicators?

We test using permutation-based IC validation (H₀: IC = 0), regime-conditional forward-return t-tests, and expanding-window walk-forward analysis to verify temporal stability of any detected signal.

Null hypothesisH₀: Fâ weight carries zero linear information vs. forward returns
AlternateH₁: |Spearman IC| > 0, statistically significant at α = 0.05
Regime hypothesisH₀: Fâ figure assignment is uncorrelated with HMM regime label
FalsifiabilityAny result — positive, negative, or null — is fully reportable. Negative IC is a finding, not a failure.

Encoding system — 4-bit market state

BitDimensionCondition (= 1)Weight
Bit 3Macro trendClose > MA(200)0.40
Bit 2Medium trendClose > MA(50)0.30
Bit 1Short trendClose > MA(20)0.20
Bit 0Micro momentumRSI(14) > 500.10

0000 = Yeku (all signals bearish, crisis_propensity = 0.95)  →  1111 = Gbe (all signals bullish, crisis_propensity = 0.05)

Spectrum: 0000 → 1111

Yeku
-0.90
Turukpe
-0.40
Odi
+0.00
Guda
+0.40
Tche
+0.70
Gbe
+0.90

Analysis pipeline

01

Symbolic Encoder

4-bit binary → Fâ figure assignment. All signals lagged by 1 day (look-ahead bias prevention).

02

Feature Engine

Rolling MA, RSI, Bollinger Bands, ATR, realized vol, drawdown. lag_signals=True default.

03

Regime Detector

Gaussian HMM on [log_returns, vol_20, drawdown]. HMM states labelled by Euclidean distance to Fâ attribute vectors.

04

Validation Layer

Spearman IC × horizons [1,5,21,63d]. Permutation test H₀: IC=0. Walk-forward expanding window.

API quick start

POST /api/analyze

curl -X POST /api/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "ticker":    "SPY",
    "start":     "2018-01-01",
    "end":       "2024-12-31",
    "n_regimes": 4,
    "benchmark": "^GSPC",
    "allow_short": false
  }'

Response schema (excerpt)

{
  "ic_table": [
    { "horizon": 1,  "IC": -0.06, "p_value": 0.12 },
    { "horizon": 5,  "IC": -0.10, "p_value": 0.03 },
    { "horizon": 21, "IC": -0.04, "p_value": 0.31 }
  ],
  "permutation_test": {
    "observed_ic": -0.10,
    "p_value":      0.031,
    "reject_h0":    true
  },
  "chart_data": { "dates": [...], "close": [...] }
}

Epistemic note

The Fâ system is used here as a structured discrete-state vocabulary for labelling market configurations — not as a causal or predictive claim. The 16-figure space is a natural combinatorial consequence of 4 binary market indicators; the Fâ naming and attribute system provides a human-readable label for each state. Statistical significance (p = 0.03) establishes that the encoding is non-random relative to forward returns. It does not establish directionality of causation, out-of-sample stability, or practical trading value.