A Machine Learning Approach to Regime Modeling
Citation. Alex Botte and Doris Bao (Two Sigma Investments). "A Machine Learning Approach to Regime Modeling". Two Sigma, Street View, 6 October 2021. The web page and its PDF, nine pages with two appendices. It is a firm's article, with no venue, no review, and no code or data. The factors come from the Two Sigma Factor Lens, which isn't public. The disclosure says the report is "for informational and educational purposes only". It adds that Two Sigma "may have a significant financial interest in (or against)" the positions it discusses.
Status. Planned. #328 holds the project's version. It is a regime model on public daily factors, refitted on past data only, that reports a strategy's results by market condition. That would sit beside the fixed crisis windows of open_familyoffice/stress.py (#219).
Read. Read on 2026-11-28. A subagent read the web page in full. I extracted the PDF with pdftotext and read its text, its footnotes and both appendices. The exhibits are images, so I saw only their captions and the numbers that the text repeats. The means, volatilities and correlations of each condition are in those images, and I did not see them. I recomputed the Walking on Ice spell length from Appendix 2.
Summary
Claim. A Gaussian mixture model, fitted to 17 factors, finds four market conditions in U.S. markets since 1971. They are Crisis, Steady State, Inflation and Walking on Ice. The conditions change "rather rapidly", and allocators can sample from them to stress-test portfolios. The authors state that "this model is not predictive".
Method.
- The data. The 17 factors of the U.S. Two Sigma Factor Lens, daily. Most start in 1971, and Equity Short Volatility, Fixed Income Carry and Trend Following start in 1986, 1991 and 1992 (Appendix 1). The Crowding factor is left out "given data limitations".
- The model. A Gaussian mixture with four clusters, each a 17-dimensional normal with its own means, volatilities and correlations. Each day is classified on its own. The model has no transition matrix and no memory.
- The number of clusters. It is "the only hyper-parameter". The authors chose it by cross-validated log-likelihood, and say that AIC and McAssey's (2013) goodness-of-fit test gave "similar" results. They give no scores.
- The fit. The parameters were "fit using data for the period starting on the dates in Appendix 1 and ending in late 2020" (footnote 4). The same model then labels 1971 to 2020, and January 2020 to July 2021.
Findings, as the source reports them.
| Setting | Number | Value |
|---|---|---|
| 1971–2020 | the most frequent condition | Steady State |
| The same | each other condition's share of periods | "roughly 15-20%" |
| Walking on Ice against the long term | annual volatility of Value, Momentum and Low Risk | 18.2% vs 8.9%, 19.1% vs 10.5%, 20% vs 10.4% |
| The same | the factors' volatility, on average | 1.6 points above their long-term averages |
| January 2020 – July 2021 | the highest daily probability of Inflation | 0.01% |
| Appendix 2: the day after a Walking on Ice day | Walking on Ice, Steady State, Crisis, Inflation | 1,782, 137, 80, 2 days (89.1%, 6.8%, 4.0%, 0.1%) |
| The same, the day before | the same | 1,782, 139, 76, 4 days |
From Appendix 2, the model labelled 2,001 days Walking on Ice. A day of it was followed by another 89.1% of the time, so a spell lasted 9.1 days on average. That is 2,001 days over 219 entries into the condition.
Where the claims go beyond the evidence
Every historical label is in sample. The model is fitted on data to late 2020 and then labels the same period. A Crisis day in 1987 is labelled by a model that saw 2008 and 2020. Only January 2020 to July 2021 lies partly outside the fit, and the fit ends in late 2020, inside that window. The article gives no out-of-sample test.
"Rare to persist" and the appendix disagree in part. The article says it "was rare for one market condition to go for long periods without interruption". Appendix 2 shows that a Walking on Ice day was followed by another 89% of the time, so its spells last about nine days. The model labels each day on its own, so this persistence comes from the data, such as volatility that clusters. A model with memory, an HMM or an HSMM, would likely label longer spells (#233, #234).
No uncertainty. The article gives no error for any mean or volatility, and says only that "there are error bounds around these estimated means". It doesn't report the cross-validation scores, the other numbers of clusters it tried, or how stable the four clusters are across seeds and samples.
No evidence of use. The article proposes stress tests and "tactical shifts on shorter horizons", but it runs neither. It gives no backtest, no costs and no comparison with simple rules, such as a volatility threshold.
Credit. The authors say plainly that the model is not predictive. They say that its labels are their own reading of clusters that "won't necessarily map exactly to well-known market environments". They give the start date of each factor and the transitions of one condition.
Use in this repo
Stress windows by condition, not only by date. stress.py (#219) reports a strategy in three crisis windows that were fixed in advance. A regime model would add every day of each condition, not three short windows. #328 holds that, with two conditions on it. First, it uses public daily factors, such as Fama–French and FRED, because the Factor Lens isn't public. Second, it refits on an expanding window, so each day's label uses only the past (splits.py, #10).
The look-ahead is the main lesson. A backtest that takes these labels as an input would see the future through them. The same holds for any regime model fitted once on the whole sample. The harness's look-ahead oracle (#87) can't catch it, because the leak sits in the input, not in the feed. So #328 asks for labels fitted on past data only.
Three structures to compare. A GMM has no memory. An HMM assumes that a regime's length is geometric, and an HSMM models the length (#234). Appendix 2's nine-day spells are evidence that memory matters for labelling, if not for prediction. #328 should compare the GMM with the HMM of #233. #234's paper is still to be read.
The number of clusters is a trial. The authors chose four by cross-validation. Every number tried is a trial of the project's ledger (#7), and so is every factor set.
No strategy here. The article proposes no rule to trade, so it gives the harness nothing to evaluate.