Back Testing
Back Testing
Back Testing
Key Points
Empirical Finance is in crisis:
Our most important discovery tool is historical simulation.
And yet, most backtests published in the leading Financial journals are wrong.
SECTION I
The General Backtesting Problem
Special Solutions
When the algorithmic strategy has an algebraic representation,
statistical methods can be used.
Familywise Error Rate (FWER): Probability of even one false discovery.
Hochberg and Tamhane [1987].
False Discovery Rate (FDR): Probability of a set proportion of false discoveries.
Benjamini and Hochberg [1995].
Some econometric applications of FWER & FDR:
Distribution of the maximal 2: Foster, Smith and Whaley [1997].
Data snooping: Harvey and Y. Liu [2014], White [2000].
Italian mathematician Carlo Bonferroni was the first (c.1936) to realize
that p-values may understate the probability of a false positive. The key
objective of the above procedures is to correct the effects of multipletesting on p-values.
Surprisingly, 79 years later, most papers in Finance still do not correct
for multiple testing, a phenomenon known as p-hacking. Most other
academic fields have been addressing this issue for decades Why?
General Solutions
When the algorithmic strategy does not rely on an algebraic
representation, no p-values can be corrected. Two alternatives:
Closed-form solution: Evaluate if the objective function (e.g., Sharpe ratio) is
significantly higher than its expected maximum value after N trials.
Bailey and Lpez de Prado [2014]
Non-Parametric solution: Given N alternative configurations, determine if the
optimal configuration in-sample consistently outperforms the median of
configurations out-of-sample.
Bailey, Borwein, Lpez de Prado and Zhu [2014]
Harvey and Liu [2014]
IMPORTANT: When someone comes to you with a machine learning
strategy, always ask if s/he has controlled for the number of trials. If
the answer is NO, run away as fast as you can.
It does not matter if s/he has applied X-validation, hold-out, etc. When
uncorrected by the number of trials, results will always be useless.
9
SECTION II
General Closed-form Solution
Backtest Overfitting
7
Expected Maximum
Sharpe Ratio as the
number of
independent trials N
grows, for = 0
and 1,4 .
1 Z 1 1
E max V
0
0
100
200
300
400
500
600
Variance=4
1
1
+ Z 1 1 1
700
800
900
1000
Data Dredging:
Searching for empirical
findings regardless of
their theoretical basis
is likely to magnify the
problem, as V
will increase when
unrestrained by theory.
This is a consequence of pure random behavior. We will observe better candidates even
if there is no investment skill associated with this strategy class ( = 0).
11
0 =
4 1 2
1 3 + 4
where
0 =
1
2250
1 1 1
1
100
+ 1 1
1
1
100
0.1132
2.5
0.1132
250
1249
2.5 101
1 3
+
4
250
2.5 2
250
= 0.9004.
14
1.8
0.99
1.6
0.98
1.4
0.97
1.2
0.96
0.95
0.8
0.94
0.6
0.93
0.4
0.92
0.2
0.91
0.9
10
20
30
40
50
60
70
80
90
100
SR0, annualized
DSR
SECTION III
General Non-Parametric Solution
=
==
2
2
2
1
2
=0
19
20
OOS
B
C
D
C
D
D
C
B
B
A
A
A
D
D
C
D
C
B
SECTION IV
Backtesting as an Industry-Only Research Tool
24
25
26
28
SECTION V
The stuff nobody reads
Bibliography
Bailey, D., J. Borwein, M. Lpez de Prado and J. Zhu (2015): The Probability of
Backtest Overfitting. Journal of Computational Finance, forthcoming. Available at:
http://ssrn.com/abstract=2326253
Bailey, D., J. Borwein, M. Lpez de Prado and J. Zhu (2014): Pseudo-Mathematics
and Financial Charlatanism: The Effects of Backtest Overfitting on Out-Of-Sample
Performance. Notices of the American Mathematical Society, 61(5), May.
Available at: http://ssrn.com/abstract=2308659
Bailey, D. and M. Lpez de Prado (2012): The Sharpe Ratio Efficient Frontier.
Journal of Risk, 15(2), Winter. Available at http://ssrn.com/abstract=1821643
Bailey, D. and M. Lpez de Prado (2015): Stop-Outs Under Serial Correlation and
'The Triple Penance Rule, Journal of Risk, forthcoming. Available at
http://ssrn.com/abstract=2201302
Carr, P. and M. Lpez de Prado (2014): Determining Optimal Trading Rules
Without Backtesting, Working paper. Available at http://arxiv.org/abs/1408.1159
Lpez de Prado, M. (2015): Quantitative Meta-Strategies, Practical Applications
(IIJ), 2(3), Spring. Available at http://ssrn.com/abstract=2547325
30
Bio
Marcos Lpez de Prado is Senior Managing Director at Guggenheim Partners. He is also a Research
Fellow at Lawrence Berkeley National Laboratory's Computational Research Division (U.S. Department
of Energys Office of Science), where he conducts unclassified research in the mathematics of largescale financial problems and supercomputing.
Before that, Marcos was Head of Quantitative Trading & Research at Hess Energy Trading Company (the
trading arm of Hess Corporation, a Fortune 100 company) and Head of Global Quantitative Research at
Tudor Investment Corporation. In addition to his 17 years of trading and investment management
experience at some of the largest corporations, he has received several academic appointments,
including Postdoctoral Research Fellow of RCC-Harvard University and Visiting Scholar at Cornell
University. Marcos earned a Ph.D. in Financial Economics (2003), a second Ph.D. in Mathematical
Finance (2011) from Complutense University, is a recipient of the National Award for Excellence in
Academic Performance by the Government of Spain (National Valedictorian, 1998) among other awards,
and was admitted into American Mensa with a perfect test score.
Marcos serves on the Editorial Board of the Journal of Portfolio Management (IIJ) and the Journal of
Investment Strategies (Risk). He has collaborated with ~30 leading academics, resulting in some of the
most read papers in Finance (SSRN), four international patent applications on High Frequency Trading,
three textbooks, numerous publications in the top Mathematical Finance journals, etc. Marcos has an
Erds #2 and an Einstein #4 according to the American Mathematical Society.
31
Disclaimer
The views expressed in this document are the authors
and do not necessarily reflect those of the
organizations he is affiliated with.
No investment decision or particular course of action is
recommended by this presentation.
All Rights Reserved.
32
Notice:
The research contained in this presentation is the result of a
continuing collaboration with
David H. Bailey, Berkeley Lab
Jon M. Borwein, FRSC, AAAS
Peter P. Carr, Morgan Stanley, NYU
Jim (Qiji) Zhu, WMU
The full paper is available at:
http://ssrn.com/abstract=2547325
For additional details, please visit:
http://ssrn.com/author=434076
www.QuantResearch.info