Machine-learning stock selection
Original study: five learners and a factor score on 140 point-in-time features
The first version's edge came from market-state inputs that drift out of their training range. Once those were made stationary, no model beat the equal-weight universe.
Overview
The idea
Each month, rank the S&P 500 by expected return over the next month, buy the top 50, and see whether that beats holding all of them. Five learning algorithms and one hand-built factor score answer the same question from the same 140 point-in-time features.
Design
- Models: ridge regression, random forest, XGBoost, a LambdaMART ranker and a neural network (five seeds averaged), against a textbook factor composite with no machine learning.
- Features: price and volume history, fundamentals as first filed, and market-state series (rates, inflation, credit, volatility) as published at the time.
- Evaluation: a purged walk-forward; models never see a return that overlaps the test month; tested 2015 to 2026 at 10 basis points of cost.
- The fair hurdle: the same usable index members at equal weight, built by the same engine at the same cost.
What happened
The first version looked promising: several models beat the equal-weighted universe by a few points a year. Two changes, both fixed before being run, made that edge disappear:
- Market-state levels drift. Rate and inflation levels in the test years sat outside anything the models had trained on, and tree models cannot extrapolate, so they partly learned which era a date belonged to. Each level is now a z-score over its own trailing three years.
- Special dividends. One-off payouts made some yields look enormous; they are now excluded.
With both changes, no model beats the equal-weighted universe over 2015–2026. Either the raw levels carried real regime information or the first result was an artefact; this study cannot tell which, and either way the original result is too fragile to act on.
Charts
Top 50 picks, equal weight, vs the same universe at equal weight
| Series | Ann. return | Vol | Ret/vol | Max DD | Ann. return 2021+ | Beat Universe, equal weight, roll 1y |
|---|---|---|---|---|---|---|
| Neural net, top 50 | 10.6% | 22.4% | 0.56 | −49% | 11.4% | 40% |
| XGBoost, top 50 | 11.5% | 22.0% | 0.61 | −44% | 12.0% | 47% |
| Factor composite, top 50 | 10.0% | 15.2% | 0.70 | −37% | 12.1% | 36% |
| Universe, equal weight | 11.9% | 18.1% | 0.71 | −40% | 12.2% | – |
Yearly returns as a table
| Year | Neural net, top 50 | XGBoost, top 50 | Factor composite, top 50 | Universe, equal weight |
|---|---|---|---|---|
| 2015 | −3.9% | 0.3% | 4.6% | 0.4% |
| 2016 | −0.8% | 5.8% | 11.7% | 16.2% |
| 2017 | 18.7% | 16.0% | 21.3% | 20.4% |
| 2018 | 0.1% | −13.7% | −6.5% | −6.8% |
| 2019 | 38.9% | 38.7% | 20.7% | 31.0% |
| 2020 | 11.2% | 27.6% | −1.2% | 12.8% |
| 2021 | 39.4% | 32.8% | 27.9% | 30.1% |
| 2022 | −8.9% | −20.0% | 1.6% | −11.8% |
| 2023 | 16.2% | 23.5% | 1.5% | 16.2% |
| 2024 | 11.7% | 24.7% | 16.7% | 13.0% |
| 2025 | 5.6% | 4.9% | 10.7% | 11.4% |
| 2026* | 7.9% | 12.7% | 14.2% | 16.4% |
Caveats
Caveats
- Survivorship. About three quarters of index members can be priced in 2015, almost all by 2026. Collapsed risky firms are missing, which flatters models that lean on volatility; the chart marks 2021, after which coverage is high enough for a cleaner comparison.
- Thin evidence. About 140 monthly observations and seven rankings. Fixing a short gap in the membership data moved single strategies by about a point a year, as much as most gaps between models.