Statistics for Finance
Hypothesis tests and p-values
Start by assuming there's nothing there, then ask how surprising your result would be. The p-value puts a number on that surprise.
Is the strategy real?
Example, with made-up numbers. A trading strategy's backtest over 60 months earned 0.8% a month on average, with a standard deviation of 4%. That's nearly 10% a year. Has it found a real edge, or could a strategy with no edge at all produce this by luck?
The idea
A hypothesis test runs like a trial. Start from the null hypothesis: "there's no edge, the true average is 0." Then measure how far your result sits from 0 in standard errors. That's the t-statistic:
The p-value is the chance of a result at least this far from 0, in either direction, if the null were true. A small p-value means "this would be surprising if there were nothing there." The usual cut-off is 5%: below it, the result is called statistically significant and you reject the null.
If the strategy had no edge, results at least as far out as t = 1.55 would happen 12.7% of the time: the two shaded tails.
Quick check
A test gives p = 0.03. What does that mean?
Worked example: the backtest
| 1. Null hypothesis | true average = 0 |
| 2. Standard error | 4 ÷ √60 = 0.516% |
| 3. t-statistic | 0.8 ÷ 0.516 = 1.55 |
| 4. p-value, 59 degrees of freedom | =T.DIST.2T(1.55, 59) = 0.127 |
12.7% is above 5%, so luck is a believable explanation. The same average over 120 months would give t = 2.19 and p = 3%, which is significant. Rule of thumb: with large samples, |t| above about 2 means p below 5%. This matches the last lesson: a 95% confidence interval contains 0 exactly when p is above 5%.
Two ways to be wrong, and the backtest trap
| False positive (type I error) | Calling luck a real edge. At a 5% cut-off, this happens 5% of the time when there's nothing there. |
| False negative (type II error) | Missing a real edge, usually because the sample was too small. |
The 5% false-positive rate is per test. Test 20 useless strategies and the chance that at least one looks significant is 1 − 0.9520 = 64%. That's why a strategy picked as the best of many backtests usually disappoints in real trading. Analysts call this data mining, and they demand a t well above 2 when many ideas were tried.
Try it yourself
Test any average against any null value.
| Standard error | |
| t-statistic | |
| p-value (two-sided) | |
| At a 5% cut-off |
Common mistakes
Three slips beginners make.
- Reading p as the chance the null is true. It's the chance of data this extreme if the null is true.
- Treating "not significant" as "no effect". It means the data can't tell. A bigger sample might.
- Confusing significant with important. With huge samples, a tiny, useless edge can be significant. Look at the size of the effect too.
Remember
- Assume the null, then ask how surprising the data are. t = (estimate − null) ÷ standard error.
- p-value: the chance of a result at least this extreme if the null is true. Below 5% is called significant. In Excel, =T.DIST.2T.
- Test many ideas and some will look significant by luck. Be suspicious of the best of many backtests.
Check yourself
Three questions. Try them without scrolling up.
1. A fund's average extra return is 2% with a standard error of 0.8%. What's the t-statistic against a null of 0?
2. You backtest 40 strategies that have no real edge, each at a 5% cut-off. About how many will look significant?
3. A test of a new factor gives p = 0.20. What should you conclude?
Simulation
Monte Carlo and bootstrapping: let the computer play out thousands of futures.