Basic Prerequisites: Statistics & Inference.
1. Intuition & Practical Objective
This page builds the why of the whole folder with no prior ML or finance background needed. The objective is one idea: when the signal you are trying to learn is far weaker than the noise around it, a flexible model will “learn” the noise instead - and the more flexible it is, the more noise it memorizes. That is the fundamental reason most financial ML fails.
Start with a dumb question: why can a computer recognize a cat? Because a cat image is mostly signal - structure that is stable across all the photos. Now ask: why does an ML model for daily stock returns fail? Because a day’s return is almost all noise - the tiny predictable part (the signal) is drowned out. A model that fits the training data perfectly is therefore not “smart,” it is memorizing the particular noise pattern of those days, which will never repeat.
The classic picture is the bias–variance tradeoff (ESL eq. 7.9):
Three ideas, three “aha”s:
- There is a floor you cannot remove. Even a perfect model still carries - the noise in the data. In finance that floor is almost everything: of daily return variance is noise.
- Flexibility buys variance. A simple (high-bias) model can’t capture the signal but won’t overfit; a complex (low-bias) model captures the signal but also memorizes noise, and its out-of-sample error rises past a point.
- Out-of-sample performance is the only truth. In-sample can be made arbitrarily high by adding parameters - a 25-degree polynomial can fit pure noise to while predicting worse than guessing out-of-sample. That is exactly what an overfit quant backtest looks like.
2. Mathematical Ground Truth & Derivations
The bias–variance decomposition. For a target with independent noise of variance , and an estimator fit on a training set, the expected squared error at a fixed point is (ESL §2.9 / eq. 7.9):
The three terms move in opposite directions as model complexity grows: complexity lowers Bias but raises Var. In a high-noise problem the Var term grows fast, so the total MSE is minimized by a deliberately simple model. This is why the industry default for tabular factor data is shallow gradient-boosted trees with aggressive regularization, not deep networks - deep networks win in high-SNR domains (vision, speech) and lose in low-SNR finance unless heavily regularized.
Where overfitting shows up in numbers. For a linear model with parameters fit on independent samples, the in-sample error understates the true error by roughly the optimism term (ESL §7.4):
With small and large, the gap is huge - the model can drive in-sample error to zero while test error stays at (or above) the noise floor. In low-SNR finance this gap is the whole story: the fewer genuinely independent samples you have, the faster a flexible model locks onto noise.
3. Computational Implementation - watch a polynomial memorize noise
A single experiment makes the entire intuition concrete: generate low-SNR finance-like data (a mild hidden curve buried in noise), fit polynomials of increasing degree on a small training set, and compare in-sample vs out-of-sample . Stdlib only.
The linear model (degree 1) is the only one that generalizes ( OOS). Each extra degree lifts in-sample (to at degree 15) while collapsing OOS - down to at degree 15 and a catastrophic at degree 25, i.e. worse than predicting the mean. That rising in-sample score is the illusion every overfit backtest sells you.
4. Failure Modes & First-Principles Breakdowns
- “Higher in-sample = better model.” False in low SNR. The experiment above shows in-sample rising while OOS falls. Judge models only on honest out-of-sample error.
- Using the test set for tuning. Every time you look at test performance and adjust, the test set becomes training data and its score inflates (ESL §7.1: keep the test set “in a vault”). In finance this is how people “discover” strategies that never survive live.
- Ignoring the noise floor. Because dominates, even a perfect model can only explain of daily return variance (see 03 · The Low-SNR Problem). Any claim of large OOS is leakage, not skill.
5. References
- Hastie, Tibshirani & Friedman, The Elements of Statistical Learning
- López de Prado, Advances in Financial Machine Learning