The IID Assumption and When It Breaks
Almost every error bar, p-value and cross-validation score assumes your rows are independent draws from one unchanging distribution. Financial data violates both halves of that, which is why backtests look significant and then fail. This page shows exactly how much of your sample is real and what happens when the distribution moves.
Prerequisites: The Supervised Learning Framework, The Law of Large Numbers
Every number a model hands you with an air of confidence — a standard error, a t-statistic, a cross-validation score, a p-value — rests on one quiet assumption about your rows. It assumes each row is a fresh, unrelated draw from a single fixed process. Break that assumption and the model still trains, still reports, still prints a t-statistic of 3.2. Nothing errors. The number is simply wrong, and usually wrong in the flattering direction.
This matters more in finance than almost anywhere else, because financial data breaks the assumption twice over. Yesterday's market state carries into today, so rows are not independent. And the process generating those rows genuinely changes — regulation, participants, volatility regimes, the fact that everyone else is now running your strategy — so rows are not identically distributed either. A quant who understands nothing else about statistics but understands this will make fewer expensive mistakes than one who knows everything else.
The analogy: two ways to poll a country
You want to know how the country will vote, so you survey a thousand people.
Survey one: a thousand names drawn at random from the electoral roll. Different towns, different ages, different jobs. A thousand genuinely separate opinions.
Survey two: a thousand people queueing outside one football stadium. Same city, same club, mostly the same demographic. You collected a thousand answers, but you learned roughly what you would have learned from asking fifty people and going home. The answers repeat because the people are connected. This is dependence — the second half of your sample largely echoes the first.
Survey three: the random national sample, but you ran it eleven months ago and there has been an economic crisis since. The sampling was flawless; the country simply is not the same country. This is non-stationarity — the distribution moved out from under you.
Overlapping returns are survey two. Backtesting a 2013 model on 2024 markets is survey three. Most real financial datasets are both at once.
Naming the pieces
"IID" stands for independent and identically distributed. Write your observations as , where the subscript is just the row number and is how many rows you have. The assumption says
In plain English: every row is generated by the same underlying mechanism (that is the identically distributed part), and learning the value of one row tells you nothing whatsoever about any other (that is the independent part).
Why anyone cares comes down to one formula. If the rows really are independent, the variance of a sample average shrinks in a very specific way:
where is your sample mean, is the variance of a single observation, and is the sample size. In words: the wobble in your estimate falls in proportion to how many rows you have, so the standard error falls with the square root of . Every error bar you have ever drawn is this formula. When rows are dependent it is simply false, and the correction is not small.
The explorer below shows the honest version: a running average settling onto the truth inside a envelope. That envelope is what dependence widens.
Worked example 1: how much of your sample is real
A very common setup. You have four years of daily data, about trading days, and your signal predicts the 5-day forward return. You compute that 5-day return on a rolling basis, so you end up with observations and you feed all to your regression.
Look at two neighbouring rows. Row 1 covers days 1 to 5. Row 2 covers days 2 to 6. They share four of their five days. They are not two observations; they are one and a bit.
Make that exact. For overlapping windows of length built from independent daily returns, the correlation between two rows that are days apart is
which says in words: two windows are correlated in proportion to how many days they have in common. With : , , , , and zero beyond that.
Now the variance of the mean of correlated rows, for large , is
In words: take the textbook answer and multiply it by an inflation factor built from all the correlations you were pretending were zero. Compute it:
So the true variance of your estimate is five times what the software reported. Your effective sample size is , not . Standard errors are understated by , so every t-statistic on the page is inflated by the same factor. A reported — comfortably "significant" — is really . Not significant, not close. And notice the number is exactly what you would have got by taking non-overlapping 5-day blocks: . The overlap added no information at all, only false confidence.
Worked example 2: when the distribution itself moves
Now the other half. Independence is fine, but the process changes.
You fit a one-day 99% value-at-risk model on two calm years where annualised volatility ran at 10%. A trading year has about 252 days, so the daily standard deviation is , that is % a day. For a normal distribution the 99th percentile sits standard deviations out, so the model says:
In words: on a normal day you should lose more than % roughly one time in a hundred. Fitted honestly, validated honestly, backtested cleanly on the calm sample.
Volatility then regime-shifts to 40% annualised. The daily standard deviation becomes , that is %. Your threshold has not moved, but relative to the new distribution it now sits only
standard deviations from zero. In words: the loss you called a once-in-a-hundred-days event is now barely half a standard deviation away. The chance of a normal draw falling below standard deviations is %.
So the breach rate goes from the designed 1% to 28% — roughly one day in four. Over a 250-day year that is about limit breaches instead of the you budgeted for. The model did not degrade gracefully; the error is a factor of 28. Nobody mis-specified anything. The world changed, and "identically distributed" was the only thing holding the number up.
Independence sets how much information your sample contains; identical distribution sets whether that information is about the future. Dependence makes you overconfident about the past. Non-stationarity makes you confident about the wrong thing.
What this means in practice
Count independent events, not rows. Before trusting any t-statistic, ask how many genuinely separate bets it represents. A monthly rebalanced strategy over ten years has about decisions, not the daily P&L observations you regressed on. Sample-weighting by overlap, as in Sample Weights & Label Uniqueness, is the systematic version of this.
Random cross-validation folds leak. Shuffling time-series rows puts days from the same week in both training and test folds, so the test fold is not independent of the training data and the score is optimistic. This is why finance uses Purged & Embargoed Cross-Validation rather than plain k-fold.
Deflate before you celebrate. If your rows overlap by a factor of , divide your reported t-statistic by roughly before deciding anything. Most "significant" backtest results do not survive that single division.
Assume the distribution will move, and measure it. Test on a period after the one you trained on, refit on a rolling window, and monitor input distributions in production so you find out that the world changed from your own dashboard rather than from your P&L. That monitoring is Concept Drift Detection.
Two traps, and both are common. First: more data does not fix dependence. Going from overlapping rows to overlapping rows still gives you one-fifth of the sample you think you have — the inflation factor is a property of the overlap, not the length. The only cure is counting honestly. Second: IID is an assumption about the rows you feed the model, not about the raw market. Daily returns can be close to independent while your engineered features are massively autocorrelated, because a 60-day moving average shares 59 of its 60 inputs with yesterday's value. People check the market for autocorrelation, find little, and conclude they are safe — while every feature in the matrix is a slow-moving average of the same underlying series.
Related concepts
Practice in interviews
Further reading
- López de Prado, Advances in Financial Machine Learning (ch. 4, 7)
- Hastie, Tibshirani & Friedman, The Elements of Statistical Learning (ch. 7)
- Cochrane, Asset Pricing (ch. 11, on overlapping returns)