← ClaudeAtlas

regime-detectionlisted

Detect and label market regimes without letting the labels see the future, and state regime coverage in the form the result gate demands. TRIGGER - detect market regimes, regime detection, bull bear regime labels, volatility regime, high-vol low-vol state, risk-on risk-off; hidden markov model on returns, HMM, hmmlearn, markov switching, MarkovRegression, smoothed vs filtered probabilities; change point detection, ruptures, structural break; turbulence index, Mahalanobis distance; "my strategy only works in one regime", "does it survive 2008 or 2020"; "result_manifest says no regime coverage", regimes_covered. SKIP for forecasting volatility itself with GARCH or arch (factor-and-timeseries-research), for whether a regime-conditional result survives the trials behind it (backtest-validation), for the full pre-report audit (research-integrity-guards), and for RL or deep-learning state models (rl-and-ml-trading).
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# Regime detection **The regime chart you are looking at was drawn with the answer key.** A Markov-switching or HMM fit returns *smoothed* probabilities, and smoothed means conditioned on the whole sample: the label on the first day of a crash knows what happened in the weeks that followed. A strategy switched on those labels has been told the crash was coming. This skill measures what that is worth, what the honest alternatives lag by, and how to state regime coverage so that `../research-integrity-guards/scripts/result_manifest.py` stops refusing your result card. Every number below is printed by `scripts/regime_lookahead.py`, `scripts/regime_methods.py` or `scripts/regime_coverage.py` (numpy / pandas / statsmodels, fixed seeds). ✅ `statsmodels` 0.15.0 (2026-08-30), BSD-3-Clause, is the only estimation dependency. The Hamilton filter and Kim smoother are re-implemented in numpy inside the headline script and agree with statsmodels to 6.1e-16 (predicted), 6.7e-16 (filtered) and 1.4e-14 (smoothed), so the timing claims are checked against the library rather than assumed from it. ## 1. 🚨 Three probability series; only one is tradeable | Series | statsmodels attribute | Conditions on | Usable at the close of t-1? | |---|---|---|---| | smoothed | `smoothed_marginal_probabilities` | r_1..r_N, the whole sample | no: it has seen the future | | filtered | `filtered_marginal_probabilities` | r_1..r_t | no: it needs today's return, the one you are about to trade | | predicted | `