regime-detectionlisted
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 | `