ml4t-survivorship-bias
Installation
SKILL.md
Survivorship Bias
Testing a strategy only on securities that exist today removes the worst performers from history, inflating backtest returns by 1-2% per year.
The Problem
If you download today's S&P 500 constituents and run a backtest starting in 2008, you exclude Lehman Brothers, Bear Stearns, Washington Mutual, and every other company that was removed after distress. The remaining panel has a built-in upward bias because you already know these firms survived.
This is worst for value and small-cap strategies, which overweight distressed names - exactly the ones that get delisted. A long-short value backtest on a survivor-biased universe can show +3% alpha that vanishes entirely on a survivorship-free dataset.
The Pattern
WRONG
import polars as pl
# Use today's index members for a historical backtest
current_members = pl.read_csv("sp500_current.csv") # 2024 list
prices = pl.read_parquet("prices.parquet")