6.2.3Backtesting Frameworks

Understand survivorship bias

2,130 words10 min readdifficulty · medium1 backlinks

What Is Survivorship Bias?

The statistical distortion: If 30% of stocks from2010 went bankrupt by 2020, but your data only has the70% survivors, your backtest's average return is inflated. You're measuring performance on a pre-filtered "winners" set.

Why Survivorship Bias Happens

  1. Data vendor shortcuts: Maintaining delisted stocks is expensive. Many providers only serve active tickers.
  2. Index rebalancing: The S&P 500 kicks out poor performers. Historical "S&P 500 data" often means "current members' history," not "whoever was in the index at each point in time."
  3. Merger/acquisition erasure: Company A gets bought; its ticker vanishes. Data providers may delete its entire history.

How to Derive the Impact (Quantitative)

Let's derive the expected return distortion from first principles.

Setup

  • Universe of NN stocks at time t0t_0
  • By time t1t_1, fraction ff survive with average return rsr_s, fraction (1f)(1-f) fail with return rfr_f (often rf100%r_f \approx -100\% or 90%-90\%)
  • True portfolio return (equal-weighted):
rtrue=frs+(1f)rfr_{\text{true}} = f \cdot r_s + (1-f) \cdot r_f

Numerical Example

Diagram: Survivorship Bias Visual

The diagram shows two parallel universes: the full dataset (top) with all stocks including failures, versus the survivor-biased dataset (bottom) where failed stocks vanish. Notice how the biased dataset's average return curve is systematically higher.

How Survivorship Bias Destroys Backtests

Effect on Different Strategies

Strategy Type Bias Impact Why
Value/distressed Severe Targets struggling companies—many delisted
Momentum Moderate Chases winners, but winners can still fail mid-run
Index replication Low (if using point-in-time index) But HIGH if using "current S&P 500 history"
Small-cap Severe Higher failure rate in small caps

Common Mistakes (Steel-manning)

How to Fix Survivorship Bias

  1. Use survivorship-bias-free data:

    • Vendors Norgate, Sharadar (Quandl), CRSP, Compustat (with delisted flags)
    • Check for delisting_return or delisting_date fields
  2. Point-in-time universe construction:

    • On each backtest date, only include stocks that existed and were tradable on that date
    • Don't peek forward to see "will this stock survive?"
  3. Model delisting explicitly:

    • When a stock delists, apply realistic delisting return (often -90% for bankruptcy, -5% for merger at a discount)
    • Don't just drop the position; absorb the loss
  4. Cross-check with failure rates:

    • If your backtest universe has 0% delistings over 10 years, it's biased. Realistic: 2-5% annual delisting rate (higher in small caps)

Real-World Impact: Historical Studies

  • Brown et al. (1992): Found survivorship bias inflated mutual fund returns by 0.5-1.5% annually.
  • Elton et al. (1996): Estimated S&P 500 survivor bias at 0.3% per year (seems small, compounds to 3% over 10 years).
  • Shumway (1997): NASDAQ delisting bias: 1.1% per year for small caps.

For a backtest showing 12% annual return, 1% survivorship bias means your real strategy might make 11%—which could drop your Sharpe ratio below your risk-free benchmark.

Recall Explain to a 12-year-old

Imagine you want to test if wearing lucky socks makes you good at video games. So you ask10 pro gamers, "Do you wear lucky socks?"8 say yes. You conclude: "Lucky socks work—80% success rate!"

But wait. You only talked to pros—people who got really good. You didn't ask the1,000 kids who wore lucky socks and still lost every match. Those kids quit gaming, so you never met them. That's survivorship bias—you only see the winners, so you think the trick always works.

In stocks: if you only test your strategy on companies that still exist today, you miss all the companies that went bankrupt. Your strategy looks amazing because it "avoided" all the failures—but only because those failures were erased from your data. In real life, you'd step on those landmines.

Connections

  • 6.2.01-Choose-backtesting-platform – Some platforms handle survivorship bias automatically (QuantConnect), others don't (basic pandas)
  • 6.2.04-Account-for-lookahead-bias – Survivorship bias is a type of lookahead: you're using future info (who survived) in the past
  • 6.2.05-Transaction-cost-modeling – Delisting often incurs extra costs (illiquidity, forced sales)
  • 4.1.02-Historical-price-data – Data quality directly determines bias presence
  • 6.3.01-Sharpe-ratio – Survivorship bias inflates Sharpe by raising returns and hiding volatility spikes from failures

#flashcards/stock-market

What is survivorship bias in backtesting? :: When your dataset only includes stocks that "survived" (still trading), excluding delisted/bankrupt companies, making your backtest artificially good.

Why does survivorship bias inflate backtest returns?
Because failed stocks (which had large losses) are missing from the data, so you measure only the winners' average return, not the true portfolio average.
Formula for survivorship bias magnitude?
Δr=(1f)(rsrf)\Delta r = (1-f)(r_s - r_f) where ff is survival rate, rsr_s is survivor return, rfr_f is failure return. Bias scales with failure rate and return gap.
How to detect survivorship bias in your data?
Check if delisting rate is 0% over 10 years (unrealistic), or if vendor docs don't mention "delisted securities." Compare stock count vs known historical index size.
What is point-in-time universe construction?
On each backtest date, only include stocks that existed and were tradable on that exact date—don't use stocks that will be added to an index in the future or that already delisted.
Realistic annual delisting rate for small-cap stocks?
3-5% per year (higher than large caps' ~1-2%). If your backtest shows 0%, data is biased.
How to model delisting in a backtest?
Apply a realistic delisting return (e.g., -80% for bankruptcy, -10% for merger) on the delisting date, don't just drop the position silently.
Which strategy types suffer most from survivorship bias?
Value/distressed and small-cap strategies (target struggling companies with high failure rates). Index replication sufers if using "current members' history."
Real-world survivorship bias magnitude?
Academic studies: 0.5-1.5% annual return inflation for funds, up to 1.1%/year for NASDAQ small caps. Compounds to 5-15% over 10 years.

Concept Map

arises from

keeps

excludes

drop delisted

kicks out losers

deletes history

measures rs only

absent so no losses

quantified by

scales with

scales with

leads to

Survivorship Bias

Selection Process

Only Survivors in Data

Failed Companies Missing

Data Vendor Shortcuts

Index Rebalancing

Merger Erasure

Inflated Backtest Returns

Bias = 1-f times rs-rf

Failure Rate 1-f

Gap rs minus rf

Overstated Strategy Performance

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Survivorship bias backtesting ka sabse bada dushman hai, bhai. Socho tumne ek strategy banayi jo "low P/E stocks" kharidti hai 2010 se. Tum Yahoo Finance se datauthate ho aur backtest karte ho—result ata hai15% annual return! Ekdum mast. Par yeh data mein ek chhupa hua dhokha hai: jo companies bankrupt ho gayi (Kingfisher Airlines, Videocon, etc.), woh is data mein hain hi nahi. Tumhara backtest sirf bachne wale stocks pe testhua, jo obviouslyzyada paisa banaye.

Real trading mein tumhe failures bhi milenge. Agar tumhari strategy ne 2010 mein koi struggling company kharedi (low P/E thi), aur woh 2013 mein bankrupt ho gayi, toh tumhara 90% paisa dob gaya. Paragar woh company data mein hi nahi hai, toh tumhara backtest usko kabhi khareedega hi nahi—artificial tarike se tumne landmine avoid kar di. Isliye survivorship bias se Sharpe ratio inflate hoti hai, drawdown chhupa rahta hai. Fix simple hai: data vendor se pocho "kya delisted stocks hain?" Agar nahi, toh reliable paid data lo (Norgate, Sharadar) jisme bankruptcy history bhi ho. Point-in-time universe banao—har date pe sirf wahi stocks trade karo jo us din exist karte the. Tabhi realistic backtest milega.

Test yourself — Backtesting Frameworks

Connections