YouTube2Text

The 7 Reasons Most Machine Learning Funds Fail Marcos Lopez de Prado from QuantCon 2018 — Transcript

by Quantopian · 10,001 words · 1,484 segments · language en · Watch on YouTube

Full transcript

  1. 0:05hi we're going to get started
  2. 0:11if I can have your attention well I hope
  3. 0:17everybody's had a great day I've had a
  4. 0:20chance to talk to a lot of you in
  5. 0:22hallways between sessions everything
  6. 0:24like that which is my favorite part so
  7. 0:26it sounds like it's been very very
  8. 0:28engaging a lot of exciting talks and I'm
  9. 0:31really excited about our afternoon
  10. 0:33keynote with Marcos Lopez de Prado who
  11. 0:38it's really I think a sort of singular
  12. 0:41figure in the field he's he's extremely
  13. 0:43well published and I think my favorite
  14. 0:47thing about Marcos is he's just
  15. 0:48incredibly generous with whatever he
  16. 0:50learns so in a you know in the the field
  17. 0:53of quantitative finance historically
  18. 0:54he's just extremely secretive and very
  19. 0:57very difficult to make contact with
  20. 0:59experts and I think for his entire
  21. 1:02career Marcos has really gone against
  22. 1:05that grain he's been very very open with
  23. 1:07his with his findings he's a bit of a
  24. 1:10burn the settle for academic publishers
  25. 1:14he's always challenging the city they
  26. 1:16are in the field and demanding
  27. 1:18scientific rigor and I think that that
  28. 1:21is exactly what the the field needs so I
  29. 1:26want to tell you about his background
  30. 1:29because it's remarkable before I do that
  31. 1:31I think a bunch of you were able to pick
  32. 1:34up his new book which is advances in
  33. 1:36financial machine learning it's really
  34. 1:39an incredible book it's very near and
  35. 1:42dear to my heart and and I do mean my
  36. 1:44heart and and the rest of quanto peein I
  37. 1:48he basically lays out the the vision and
  38. 1:51business plan and scientific method for
  39. 1:53our asset management business in that
  40. 1:55book in the early chapters which is
  41. 1:59incredibly inspiring and extremely
  42. 2:01helpful so I really highly recommend
  43. 2:03that book and I want to tell you a few
  44. 2:08things about Marcos so he's the chief
  45. 2:10executive officer a true positive
  46. 2:12technologies he's had a pretty pretty
  47. 2:14remarkable year he published his book
  48. 2:17but he also bought and spun out his
  49. 2:22business true positive out of Guggenheim
  50. 2:24Partners quantity
  51. 2:25investment management investment
  52. 2:27strategies business so he's been running
  53. 2:31no big surprise machine learning
  54. 2:32strategies there and this year who's
  55. 2:35able to spin out after managing up to 13
  56. 2:38billion in assets with a trekker to go
  57. 2:42with it and Marco's is also a research
  58. 2:45fellow at the Lawrence Berkeley National
  59. 2:47Laboratory I was in the US Department of
  60. 2:50Energy and you'll see if you reads book
  61. 2:52he talks a lot about borrowing from the
  62. 2:55National Lab model in the search for
  63. 2:58alpha which i think is extraordinarily
  64. 2:59timely for the field he's also a top-10
  65. 3:03most read author in finance Corney SSRN
  66. 3:06and as i mentioned he's just very well
  67. 3:08publishes published dozens of scientific
  68. 3:10articles on ml supercomputing and he
  69. 3:13holds multiple international patent
  70. 3:14applications on algorithmic trading he
  71. 3:17earned his first PhD in financial
  72. 3:20economics in 2003 and why only get one
  73. 3:23so he got his second PhD in mathematical
  74. 3:25finance in 2011 from the university god
  75. 3:29help me with the pronunciation of the
  76. 3:31spanish word i'm about to say
  77. 3:32universidad compute intense madrid close
  78. 3:35you can correct me to get up here marcos
  79. 3:37and he is recipient of spain's national
  80. 3:40award for academic excellence in 1999
  81. 3:42and he had his postdoctoral research at
  82. 3:45Harvard and Cornell he's also a great
  83. 3:47guy so once you want up Marco's thank
  84. 3:59you for having me
  85. 4:02you guys are my favorite group of people
  86. 4:04and let me tell you why if there is an
  87. 4:09efficient if there is an an inefficiency
  88. 4:12if there is an inefficiency in financial
  89. 4:14markets anybody should be able and
  90. 4:18allowed to arbitrage it away and correct
  91. 4:21it right these are our markets these
  92. 4:24where people transact and exchange
  93. 4:26information and the saddest school today
  94. 4:30is that people are not allowed to do
  95. 4:32that in order to exploit and correct
  96. 4:37these inefficiencies typically you have
  97. 4:39to join a firm and you have to play by
  98. 4:42the rules and if you are not part of the
  99. 4:46right clubs or you don't have the the
  100. 4:49right background they may not like you
  101. 4:51and they may not want you and that
  102. 4:54sounds wrong in the 21st century and
  103. 4:58here comes quanto peon which is a
  104. 5:01wonderful experiment a wonderful
  105. 5:05experiment not only in the quantitative
  106. 5:07space but also in the social space where
  107. 5:10the goal is to disintermediate these all
  108. 5:15structures and that's why I'm very
  109. 5:18optimistic about quanto pian not about
  110. 5:21not only about what contouring can do
  111. 5:24for investors but actually what it can
  112. 5:26do for modernizing financial markets I'm
  113. 5:29breaking with the old paradigms that
  114. 5:32said we are all I believe very
  115. 5:37interested in new technologies and how
  116. 5:40these new technologies can modernize
  117. 5:42finance in particular
  118. 5:44today's presentation is about machine
  119. 5:46learning there is a lot of hype about
  120. 5:49machine learning not all of it is
  121. 5:52realistic at this point and the point of
  122. 5:56this presentation is to highlight a
  123. 6:00number of areas where machine learning
  124. 6:03can go wrong I think it is quite clear
  125. 6:08that machine learning can be an
  126. 6:11incredible irreplaceable tool for
  127. 6:14identifying inefficiencies in much
  128. 6:16in financial markets but it also with
  129. 6:21these power camp certain
  130. 6:24responsibilities and it is when you're a
  131. 6:26researcher you you have to make sure
  132. 6:29that this power does and does and
  133. 6:33doesn't end up being adverse to you all
  134. 6:39right so let me go straight to seven
  135. 6:44issues that I find frequently dangerous
  136. 6:50as it relates to machine learning the
  137. 6:53first one is a little bit philosophical
  138. 6:55is how should we organize our work what
  139. 7:00is the best way to organize work when
  140. 7:02you're conducting research applying
  141. 7:05machine learning and the old paradigm
  142. 7:09that comes back to the 1980s is a hedge
  143. 7:13fund will hire a bunch of portfolio
  144. 7:16managers in the 1980s many of them were
  145. 7:19discretionary portfolio managers and
  146. 7:21this discretionary portfolio managers
  147. 7:23will work in silos why will they work in
  148. 7:27silos well it makes sense a
  149. 7:28discretionary portfolio manager is
  150. 7:30someone who doesn't really know where he
  151. 7:33is making these decisions if he knew why
  152. 7:37he's making these decisions he would
  153. 7:39have the system and therefore he would
  154. 7:40be a systemic portfolio manager however
  155. 7:45since the decisions are not necessarily
  156. 7:48systematic and they are discretionary
  157. 7:51they're based on in many cases hunches
  158. 7:54or gut feeling how can these portfolio
  159. 7:59managers reach a conclusion well very
  160. 8:01often they don't know why they are
  161. 8:03making the decision they cannot
  162. 8:04rationalize why they are making the
  163. 8:06decision therefore it's very hard for
  164. 8:08them to work together that's why it
  165. 8:11makes sense for hedge funds to have this
  166. 8:13perform and it's working silos so that
  167. 8:15the diversification potential is
  168. 8:18exploited that way by having different
  169. 8:20perform a leaders making decisions and
  170. 8:22not influencing each other not trying to
  171. 8:24convince each other now when you bring
  172. 8:27this to the Qantas space it doesn't
  173. 8:29really make sense
  174. 8:30right the whole point of science is to
  175. 8:33build a dialogue where we can reach
  176. 8:38objective conclusions through discussion
  177. 8:40and testing so why would anybody ask
  178. 8:46scientists to work in silos it does not
  179. 8:49really make sense it is not how
  180. 8:50laboratories work it's not how
  181. 8:52universities work the whole point of
  182. 8:54science is to have a discussion a debate
  183. 8:57and to reach common conclusions so why
  184. 9:00would hedge funds do that with ones well
  185. 9:02one answer is because that's what has
  186. 9:05been successful with discretionary
  187. 9:07portfolio managers and they just think
  188. 9:08well let's repeat this protocol this
  189. 9:12procedure with with Kwan's it also has
  190. 9:16to be of course with secrecy with not
  191. 9:19allowing that some Kwan's take areas
  192. 9:22from other Kwan's and essentially the
  193. 9:24secrets go away and secrets are very
  194. 9:28important directions especially when
  195. 9:29they are automatable right when you can
  196. 9:31take the secret out of a place so there
  197. 9:34has to it has to do to some extent with
  198. 9:37secrecy but I find very often that the
  199. 9:41argument goes more like well you know
  200. 9:43everybody should stand on their own
  201. 9:45their own feet and come up with their
  202. 9:46own ideas and they should not cooperate
  203. 9:48well why this is disadvantageous because
  204. 9:50essentially building a quantitative
  205. 9:53study is much more difficult than making
  206. 9:56discretionary decisions right building
  207. 9:58it is a quantitative strategy involves a
  208. 10:02tremendous amount of effort and when you
  209. 10:06put these ones under a lot of pressure
  210. 10:09to come up with a strategy within six
  211. 10:11months essentially what I've seen very
  212. 10:13often happens is that they will come up
  213. 10:15with strategies that are either the
  214. 10:19result of practice overfitting just
  215. 10:20selecting running millions of
  216. 10:22simulations and reporting to the
  217. 10:24investment board whatever seems to work
  218. 10:25best or
  219. 10:27it will be some strategy based on some
  220. 10:30research paper very often will be some
  221. 10:33factor model that you know it has a lot
  222. 10:36of support in the academic community but
  223. 10:37the realities
  224. 10:38it may be an overcrowded strategy where
  225. 10:41with a lower ratio event
  226. 10:43what happens is that results are not
  227. 10:46where the back tests suggested and
  228. 10:52investment boards become the solution
  229. 10:54and eventually they shut down the
  230. 10:56operation so that happens very often
  231. 10:58right and this is what I call the CCP
  232. 11:02Inc ones right this is if you remember
  233. 11:05in Greek mythology Sisyphus was
  234. 11:07condemned by the gods to perform this
  235. 11:11daily routine of rolling a boulder up
  236. 11:14the mountain only to see the boulder
  237. 11:17roll down at the end of the day and he
  238. 11:20was never able to reach the summit the
  239. 11:24promise was that we feel were ever able
  240. 11:26to reach the summit he would finally be
  241. 11:28liberated but for the whole eternity
  242. 11:32Sisyphus was content to to do this
  243. 11:35futile effort where there was no hope of
  244. 11:39succeeding and I'm not saying that there
  245. 11:43is no hope of succeeding when you are on
  246. 11:44your own and you have no support and and
  247. 11:48you have no access to clean datasets or
  248. 11:52computing power it's becoming increasing
  249. 11:56increasingly difficult to succeed in
  250. 11:59such environment it would be equivalent
  251. 12:03to having a factory worker at the BMW
  252. 12:07factory and you asked that worker to one
  253. 12:11day be a welder on another day to be a
  254. 12:15mechanical engineer and Lord a TWiki to
  255. 12:17be an electrical engineer and eventually
  256. 12:23build the car with all these shops
  257. 12:26around him well that's not how car
  258. 12:30production works right typically what
  259. 12:32happens is someone is at the station and
  260. 12:35specializes and is the best that he or
  261. 12:38she can be at the job the same happens
  262. 12:42to work or seems to work quite well in
  263. 12:45finance you you can have people who are
  264. 12:48especially since supercomputer
  265. 12:50supercomputing and they will know a lot
  266. 12:52about pile processing and
  267. 12:55how to vectorize algorithms and there is
  268. 12:57so much to learn on that respect right
  269. 13:00there will be people who specialize in
  270. 13:02production software people who
  271. 13:04specialize in data cleaning and curation
  272. 13:06people who specialize in doing research
  273. 13:10coming up with what are the important
  274. 13:13features that explain a phenomenon there
  275. 13:17will be people who specialize in
  276. 13:19back-testing and think about back
  277. 13:20testing all that involves right
  278. 13:22transaction costs the possibility to
  279. 13:24trade or not what is the probability
  280. 13:25that you would get a feel and at what
  281. 13:27price so all these people kind of
  282. 13:30specialize and work together as a team
  283. 13:32right and that seems to be more
  284. 13:35efficient than asking everybody to be
  285. 13:39the best they can at everything so
  286. 13:42that's what I've seen that seems to work
  287. 13:46in in the new kind of quant
  288. 13:49firms where people are are truly the
  289. 13:54best they can at performing very well
  290. 13:57divided tasks and let me tell you one
  291. 14:00anecdote about the Manhattan Project
  292. 14:02I'm have a project involve tens of
  293. 14:05thousands of scientists and even though
  294. 14:10it was a very complicated project that
  295. 14:12involve cutting-edge science at the time
  296. 14:15they were able to divide the tasks
  297. 14:18involving that project to such level of
  298. 14:21granularity that even high school
  299. 14:24students were able to contribute to the
  300. 14:27project and that was Richard Richard
  301. 14:29Feynman's job at the muharram project
  302. 14:32was to coordinate the work of high
  303. 14:35school students and what was their work
  304. 14:37to calculate the yield of the bond of
  305. 14:40the bomb essentially they were
  306. 14:41performing the operations right they
  307. 14:43didn't have supercomputers so they had a
  308. 14:45bunch of kids solving operations that in
  309. 14:50an aggregate fashion would determine
  310. 14:52what is the yield of the bomb so that is
  311. 14:55the kind of of granularity and sub task
  312. 14:59partitioning that was achieved at that
  313. 15:02project meaning that there is no task
  314. 15:04that is so complicated that cannot be
  315. 15:07divided into
  316. 15:08tasks that are much much simpler and
  317. 15:13that seems to me something that
  318. 15:16especially when you have access to a
  319. 15:18large community of people collaborating
  320. 15:20would be very appealing pitfall number
  321. 15:26two is interior differentiation so you
  322. 15:30take any paper in financial economics
  323. 15:34written over the past 80 years and the
  324. 15:38first thing they do is always they
  325. 15:40compute returns they are trying to price
  326. 15:47securities that say that they are trying
  327. 15:49to price the value of a stocks the first
  328. 15:50thing that they will do is they will
  329. 15:51compute the cross-section of returns if
  330. 15:54this is a fixed income research paper
  331. 15:57the first thing they will do is they
  332. 15:59will operate with yield to maturities
  333. 16:01option adjust the spread you name it
  334. 16:03some sort of changes in the spreads
  335. 16:07right which what is the spread what what
  336. 16:09is the the Giotto material is
  337. 16:11essentially a duration adjusted price
  338. 16:14for a bond and they will they will
  339. 16:18compete they will work with a stationary
  340. 16:20series where they make the series
  341. 16:22stationary by completing differences of
  342. 16:24the yield the same with a paper dealing
  343. 16:28with option pricing well they will
  344. 16:30compute differences on the implied
  345. 16:31volatilities it's always about computing
  346. 16:34interior differences and when you think
  347. 16:36about it it doesn't really make sense I
  348. 16:38know everybody does it and every paper
  349. 16:41it starts like that but when you think
  350. 16:43about it doesn't really make sense there
  351. 16:46level information
  352. 16:47the prices implied volatilities yield
  353. 16:51they contain memory and when you're
  354. 16:55trying to make a prediction memory
  355. 16:57sounds like one thing that you want to
  356. 16:59preserve right you want to know how you
  357. 17:01reach that level in order to understand
  358. 17:04what the price is going to do in the
  359. 17:06future but the first thing that people
  360. 17:09do when they compute the difference is
  361. 17:11to eradicate that memory the memory is
  362. 17:13gone you compute a return and what
  363. 17:16you're doing is you're computing the
  364. 17:18divine in the price of today by the
  365. 17:20price of yesterday
  366. 17:22so whatever happened before yesterday is
  367. 17:24eradicated it's entirely removed now of
  368. 17:30course this is done because you need to
  369. 17:34work with the stationary series if the
  370. 17:36series is not as stationary then the
  371. 17:40algorithm will not be able to learn from
  372. 17:43comparable examples right you will not
  373. 17:45be able to derive a distribution that is
  374. 17:47a stable and if the distribution is not
  375. 17:49as stable the algorithm will not be able
  376. 17:52to identify patterns that are comparable
  377. 17:54to whatever observed features you have
  378. 17:57today so there is of course a reason for
  379. 18:00doing interior differentiation the
  380. 18:03problem is that when people compute a
  381. 18:06difference and the difference is in
  382. 18:08interview difference you achieve a
  383. 18:10stationarity at the cost of wiping all
  384. 18:13memory out so the question I ask myself
  385. 18:20a few years ago is is there a an optimal
  386. 18:25level of differentiation that allows you
  387. 18:28to preserve the maximum amount of memory
  388. 18:31rather than differentiating with an
  389. 18:34integer so for instance the return
  390. 18:36between yesterday and today is there any
  391. 18:39fractional differentiation any level of
  392. 18:41differentiation between zero and one
  393. 18:44right when you differentiate by order
  394. 18:46zero you are working with levels this U
  395. 18:48is not stationary so that's bad when you
  396. 18:52work so the series will be we have full
  397. 18:55memory but notice but it won't be a
  398. 18:57stationary when you are work with
  399. 18:59differentiation one the series will be a
  400. 19:02stationary but we have no memory so bad
  401. 19:04- there must be somewhere in between
  402. 19:07right there must be somewhere in between
  403. 19:09a degree of differentiation that is
  404. 19:13optimal in the sense that achieves
  405. 19:18stationarity at the minimum cost in
  406. 19:21terms of memory preservation and that's
  407. 19:24what you see in this plot here you can
  408. 19:26see a blue line that is somehow a mix of
  409. 19:30returns is it somehow a mix of white
  410. 19:33noise and levels right so you can see
  411. 19:35how
  412. 19:36the green line is the price of the SNP
  413. 19:39between 1998 and 2005 2015 sorry and the
  414. 19:46blue line is the series where we have a
  415. 19:51fractional differentiation where the
  416. 19:53order of differentiation is 0.4 this the
  417. 19:58blue line is both stationary and still
  418. 20:02it con it incorporates a lot of memory
  419. 20:05you can observe that when after 2008
  420. 20:08when they simply plummets and loses
  421. 20:11something like 40 something percent the
  422. 20:15blue line remains there is a lot of
  423. 20:17noise but is still the the values are
  424. 20:20depressed for a long period of time
  425. 20:22until eventually that memory from the
  426. 20:24immediate history wanes so let me
  427. 20:32present you the same idea with a
  428. 20:35different plot in this plot we have two
  429. 20:38lines the orange line and the blue line
  430. 20:39the blue line is the statistic from an
  431. 20:45augmented dickey-fuller test an ADF test
  432. 20:49and as you can see that the value goes
  433. 20:53from around zero to something like minus
  434. 20:5650 so it's the the values around zero
  435. 21:01when you have no differentiation so this
  436. 21:03you see is non-stationary and then by
  437. 21:06the time you differentiate you compute
  438. 21:08the return you jump from zero to one or
  439. 21:10the sign the value is minus 45 or minus
  440. 21:1450 now the series is completely
  441. 21:17stationary I mean it's like you were
  442. 21:20expecting to to achieve a level of minus
  443. 21:232.3 right when the ADF stat is around
  444. 21:26minus 2.3 you already have a 95%
  445. 21:29confidence that the series is stationary
  446. 21:31or that you have rejected the null now
  447. 21:36the orange line represents the
  448. 21:39correlation between the differentiated
  449. 21:42series and the Arenal series right and
  450. 21:46when the series is not differentiated
  451. 21:48the corrosion is 1 because
  452. 21:49the Croatian between prices and prices
  453. 21:51okay when they when you differentiate
  454. 21:54with an interior differentiation of
  455. 21:57order one
  456. 21:57now that correlation drops to 0.05 or so
  457. 22:05so what happens in between you can see
  458. 22:08that at the level of around 0.4 you have
  459. 22:13a serious actually 0.35 in this case you
  460. 22:17can achieve a an ADF test of around
  461. 22:21minus 2.86 while at the same time the
  462. 22:27differentiated series fractional
  463. 22:29differentiate disease has a correlation
  464. 22:31of 0.995 with the renal series so
  465. 22:36essentially you achieve two things this
  466. 22:38is the fractional differentiated series
  467. 22:40is very close to the reno students and
  468. 22:43yet is stationary it is a unique
  469. 22:47phenomenon not at all
  470. 22:48there is not a single future where you
  471. 22:51need to compute returns meaning that for
  472. 22:55the past 80 years people have been
  473. 23:00publishing papers out there where the
  474. 23:03series were massively over
  475. 23:04differentiated there is not a single
  476. 23:07case you can see here more returns out
  477. 23:10of the 100 most liquid futures worldwide
  478. 23:14the maximum level of differentiation
  479. 23:17that is needed is 0.5 is never 1 and in
  480. 23:21fact the meeting is around 0.3 0.2 0.3
  481. 23:25so think about it the level of
  482. 23:28differentiation that was needed that was
  483. 23:31justifiable in order to achieve a
  484. 23:32stationarity was 0.2 0.3 all the rest
  485. 23:380.32 1 just was for the sake of removing
  486. 23:42memory not for the sake of achieving
  487. 23:45stationarity is it therefore surprising
  488. 23:49that most academics claim that markets
  489. 23:52are perfect no markers appeared to be
  490. 23:56perfect by construction once you remove
  491. 23:59all memory markets become unpredictable
  492. 24:03it's not that markets are unpredictable
  493. 24:05markets are predictable we should be
  494. 24:08able to predict the markets but they
  495. 24:11become unpredictable
  496. 24:12once you remove all memory so they it
  497. 24:15appears to me that the efficient market
  498. 24:18hypothesis actually may be the wrong
  499. 24:23conclusion from utilizing a wrong
  500. 24:25technique all right pitfall number three
  501. 24:30is inefficient sampling in many papers
  502. 24:35you see that people academics especially
  503. 24:38they utilize sample they take samples
  504. 24:43based on a chronological clock
  505. 24:45essentially they will take samples every
  506. 24:47day or every hour or every minute either
  507. 24:50at a constant pace right at a time base
  508. 24:56constant distance now that doesn't
  509. 24:59really makes a lot of sense because
  510. 25:01clearly markets do not receive
  511. 25:03information at a constant rate markets
  512. 25:08receive a lot of transactions and volume
  513. 25:10but they open then there is a ballet
  514. 25:13around noon and then volume spikes
  515. 25:16tremendously around 3:00 p.m. until the
  516. 25:20close 4:00 p.m. new your time I'm
  517. 25:22talking about equity markets but you
  518. 25:25know in oil it will be the volume will
  519. 25:28spike around 1 p.m. in fixed income for
  520. 25:33depends on the market but essentially
  521. 25:35these valet feature is it's very
  522. 25:38characteristic now when you sample it
  523. 25:42makes sense to sample data when there is
  524. 25:44information to be extracted I mean why
  525. 25:47would you sample when there is no
  526. 25:48information to be strike actually that's
  527. 25:50a bad sample right it's about sample
  528. 25:53because it just leads to redundant
  529. 25:54observations observations that do not
  530. 25:57bring information it's counterproductive
  531. 26:00in fact two sample observations when
  532. 26:04there is no information to be extracted
  533. 26:06so alternative approaches are to compute
  534. 26:11trade VARs volume bars dollar VARs
  535. 26:13volatility on
  536. 26:16grunts order imbalance entropy bars the
  537. 26:20book describes many of these let me give
  538. 26:23you an explanation of one a sense so for
  539. 26:26instance you could compute dollar bars
  540. 26:28we're essentially you're forming a bar
  541. 26:31whenever you accumulate a dollar amount
  542. 26:35traded on a particular side
  543. 26:37so whenever markets are very balanced in
  544. 26:41terms of buys and sells you're going to
  545. 26:45produce bars whenever a particular
  546. 26:47demand has been traded now suppose that
  547. 26:49all of a sudden an informed trader
  548. 26:52arrives to the market and this informed
  549. 26:56trader thinks that the price will go up
  550. 26:58and therefore becomes a very aggressive
  551. 27:00buyer as a result now the bond will be
  552. 27:03very imbalanced and this kind of
  553. 27:07sampling mechanism will sample more it
  554. 27:11will sample more because it will be
  555. 27:12easier to generate an amount of trading
  556. 27:16on a particular side of the market in
  557. 27:17this case buyers and that's exactly what
  558. 27:21you want to do someone has arrived to
  559. 27:23the market this person has a symmetric
  560. 27:26information is utilizing this asymmetric
  561. 27:29information to press a particular side
  562. 27:31of the market the algorithm detects that
  563. 27:34and samples more why because you want to
  564. 27:36learn what does person knows right
  565. 27:39this person is acting this way because
  566. 27:41he has a symmetric information and you
  567. 27:44want to join that you want to extract
  568. 27:46that information that he that he said
  569. 27:49that he knows off and he's incorporating
  570. 27:51into the price let me give you an
  571. 27:55illustration of why these sampling
  572. 27:58methods seem to work well there are here
  573. 28:01three plots there is a blue a green and
  574. 28:05a black line the black line is the
  575. 28:07number of parts per day of a particular
  576. 28:10size let's say 50 on average per day
  577. 28:12that you would extract if you use stick
  578. 28:16bars if you let's say that you compute
  579. 28:18you sample one bar every time that is
  580. 28:22certain number of ticks is exchanged now
  581. 28:26as you can see this line is quite
  582. 28:29is quite far from a flatline he starts
  583. 28:34at the level of around 25 and then what
  584. 28:37goes all the way up to 100 and then it
  585. 28:40goes down to around 50 over time why
  586. 28:43because this bar is affected by
  587. 28:47high-frequency trading as high-frequency
  588. 28:52trading has become a prevalent
  589. 28:54technology in financial markets the
  590. 28:56order size has decreased because there
  591. 29:01are more tics for every given amount of
  592. 29:03volume traded as you can see beginning
  593. 29:072007 it goes up and then around 2012
  594. 29:12reaches a peak and then there was a
  595. 29:14change in the fixed protocol that reduce
  596. 29:19the number of fragmentation in the
  597. 29:21trades so then the this line decreases
  598. 29:24but it's really a function of changes in
  599. 29:26the fixed protocol so we would like to
  600. 29:29avoid that right we would like up to
  601. 29:31about that the sampling frequency is a
  602. 29:34function of new technologies arriving or
  603. 29:37changes to protocols so that's where the
  604. 29:39green line arrives that's volume VARs
  605. 29:41right on volume bars take a take a
  606. 29:43sample every time that is particular
  607. 29:46volume not tick volume number of
  608. 29:49contracts is change takes place in the
  609. 29:53market and as you can see this series is
  610. 29:56now much more stable now the blue line
  611. 30:00is even more stable than the than the
  612. 30:03green line and that's all our vs.
  613. 30:04entually now we're taking to account
  614. 30:05information about the price that has the
  615. 30:11dollar amount exchanged not only the
  616. 30:14volume information but also the price
  617. 30:16information so that's a much more stable
  618. 30:20way of sampling and it's a stable and is
  619. 30:25less dependent on technological features
  620. 30:27or or price action so people number for
  621. 30:33wrong labeling very often you see in the
  622. 30:36financial literature that people label
  623. 30:41observations
  624. 30:42from financial markets in a rather
  625. 30:45automatic way as if they were dealing
  626. 30:48with faces from a Facebook or or or
  627. 30:54dealing with some sort of non-financial
  628. 30:57data set so essentially what they will
  629. 31:00do is they will take they will make some
  630. 31:04observations and then they will sample
  631. 31:06these observations based on what is the
  632. 31:09return over a given fixed horizon so
  633. 31:12over the next 10 bars or 10 days well
  634. 31:16that doesn't really make sense because
  635. 31:17when you think about it number one time
  636. 31:21bars are do not exhibit good statistical
  637. 31:24properties so when you complete returns
  638. 31:26based on time bars this series typically
  639. 31:29will have will be heteroscedastic so
  640. 31:33they won't have a constant variance they
  641. 31:35they will have they will exhibit
  642. 31:37substantial serial correlation
  643. 31:39well why because there will be many
  644. 31:42observations made during the night where
  645. 31:44there is very little volatility and then
  646. 31:46all of a sudden minutes some versions
  647. 31:48during the day which again they will
  648. 31:50have they will exhibit this sort of zero
  649. 31:53correlation the distribution will be non
  650. 31:56normal it will be skewed there will be a
  651. 31:59skewness and kurtosis so sampling with
  652. 32:03time bars is a bad idea and we have seen
  653. 32:05this before
  654. 32:06now labeling based on a fixed time
  655. 32:10horizon it just incorporates once again
  656. 32:15wrong information right you should label
  657. 32:17not based on what happens over the next
  658. 32:1910 bars but whether you achieve the
  659. 32:22objective of a position under those
  660. 32:25circumstances so let me give you an
  661. 32:27example that's what that's by the way
  662. 32:29that's what I call the triple very
  663. 32:31method so this is the alternative to
  664. 32:34what is being done in most papers out
  665. 32:38there the idea is you are going to label
  666. 32:43an observation based on the outcome as
  667. 32:47if you had a position at that point in
  668. 32:49time so you form three bars you form two
  669. 32:54horizontal barriers
  670. 32:56one up and one down and then a vertical
  671. 32:58barrier and essentially this
  672. 33:00incorporates the information that you
  673. 33:02would follow if you were holding a
  674. 33:07position right the upper barrier is a is
  675. 33:10this is a profit-taking level the lower
  676. 33:13barrier is a stoploss barrier and the
  677. 33:16vertical very essentially just tells you
  678. 33:18we had we held in this position for a
  679. 33:21particular horizon and now it's time to
  680. 33:23you know move on now when you do that
  681. 33:27what is the difference the the the
  682. 33:32traditional method of a Causton of a
  683. 33:35constant time barrier or time horizon
  684. 33:37essentially the equivalent to have to
  685. 33:39holding a vertical barrier without the
  686. 33:42horizontal very without the horizontal
  687. 33:44where is you see that right if you are
  688. 33:46holding a position for the next ten days
  689. 33:47and you don't care what happens in
  690. 33:49between essentially this is equivalent
  691. 33:50to having no barriers no horizontal
  692. 33:53various and you just label based on the
  693. 33:56outcome at the end now when you
  694. 33:58incorporate the two horizontal various
  695. 34:00what you're doing is you are
  696. 34:02incorporating information about the path
  697. 34:03right now labeling will be path
  698. 34:07dependent essentially what you're doing
  699. 34:09is you will label an observation as a
  700. 34:13one is if you would have taken a profit
  701. 34:17if you would have made a profit that
  702. 34:19after holding that position if they lay
  703. 34:23the observation will be labeled as a
  704. 34:24minus one if you would have been a
  705. 34:26stopped out and who has not being a
  706. 34:28stopped out at some point in time it's
  707. 34:30very healthy right
  708. 34:31so not incorporating that health
  709. 34:33information into your machine learning
  710. 34:34algorithm probably is a bad idea and you
  711. 34:39have to give it to the academics it only
  712. 34:41it takes to be only an academic board
  713. 34:45label observations without taking into
  714. 34:47account the possibility of a stop out
  715. 34:48anybody managing a portfolio for real
  716. 34:50knows that you have to take into account
  717. 34:53the possibility of being a stopped out
  718. 34:54right it doesn't matter where the price
  719. 34:57is after ten days if you were managing a
  720. 35:00position during the flash crash you know
  721. 35:02that the stop outs can kick in anytime
  722. 35:07now how is this relevant well there is a
  723. 35:12lot of interest these days for what I
  724. 35:16call quant quanta mental firms and let
  725. 35:19me tell you one way one natural way that
  726. 35:21firms can incorporate information the
  727. 35:29how fundamental firms can actually use
  728. 35:31machine learning methods in their daily
  729. 35:33decision making one way is to combine to
  730. 35:41add a machine learning layer to your
  731. 35:45traditional fundamental decision making
  732. 35:47suppose that you have you work for a
  733. 35:49firm that is very fundamental where
  734. 35:51people make decisions based on either
  735. 35:53book information accounting or
  736. 35:55traditional economic models and now what
  737. 36:01you would like to do is not to challenge
  738. 36:03the decisions be made by those models
  739. 36:05but what you would like to do is to
  740. 36:07determine what is the bearing size how
  741. 36:11much should we bet on these forecasts
  742. 36:14made by the fundamental model so that's
  743. 36:17what I call meta leveling meta labeling
  744. 36:22is is a it's a very nice way of
  745. 36:27combining machine adding a machine
  746. 36:30learning layer to any sort of
  747. 36:34theoretical model whether the model is
  748. 36:36econometric economic fundamental it
  749. 36:40doesn't matter the Machine the the role
  750. 36:42of the machine learning algorithm is to
  751. 36:43figure out how much should we bet if
  752. 36:46anything at all in this prediction that
  753. 36:49the algorithm has made or or that this
  754. 36:55primary model has made now this is very
  755. 37:00helpful in the following sense suppose
  756. 37:04that you have an algorithm that has low
  757. 37:08precision but high recall right this is
  758. 37:11an algorithm that is able to identify
  759. 37:15almost all positives however it has a
  760. 37:18large
  761. 37:19number of false positives right and
  762. 37:23essentially like most economies who
  763. 37:26predict 20 out of the last ten
  764. 37:28recessions right and so that's an
  765. 37:31example economies are exciting example
  766. 37:33of an algorithm that has high recall and
  767. 37:36low precision and now what we would do
  768. 37:40is we would incorporate a machine
  769. 37:41learning algorithm on top of that
  770. 37:43economists another machine learning
  771. 37:45algorithm is going to figure out how
  772. 37:47much should we bet on the forecasts made
  773. 37:49by this particular economists given
  774. 37:51previous examples of predictions made by
  775. 37:53these economists and why did why is this
  776. 37:57helpful because if you have a model that
  777. 37:59has high recall it's not so important
  778. 38:02that it has low precision now the
  779. 38:04machine learning algorithm will reduce
  780. 38:08the recall in exchange for increasing
  781. 38:12the precision and there is an optimal
  782. 38:14level out there where you can maximize
  783. 38:17the harmonic average the harmonic
  784. 38:20average of the two of precision and
  785. 38:22recall and that's what these machine
  786. 38:23learning algorithm would do all right
  787. 38:28pitfall number five waiting on of non
  788. 38:31iid samples you know finance is very
  789. 38:36funny
  790. 38:37as it comes down as it relates to
  791. 38:39machine learning in a traditional
  792. 38:42machine learning application like for
  793. 38:44instance by medical research suppose
  794. 38:47that you are a doctor and someone asks
  795. 38:49you well what are the features that are
  796. 38:51conducive of high cholesterol what you
  797. 38:54would do is we would take your sample of
  798. 38:56everybody you know samples from
  799. 38:58everybody here in the audience and we
  800. 39:00would label them right and then we would
  801. 39:03ask some questions about what is your
  802. 39:04diet you know what exercise routines the
  803. 39:08genetic predisposition to cholesterol
  804. 39:11etc yeah you would you would ask a
  805. 39:15number of questions and you would try to
  806. 39:16identify these features are predictive
  807. 39:18of your observation that is in that tube
  808. 39:22one tube per person right independent
  809. 39:25samples one tube per person but
  810. 39:29finance is not like that right finance
  811. 39:31what happens in finance is that
  812. 39:32essentially someone takes all these
  813. 39:34tubes and messes them up and now what
  814. 39:37happens is that the blood contained in
  815. 39:39tube number-19 contains information from
  816. 39:43you know subjects eight seven six and
  817. 39:46five and tube number twenty contains him
  818. 39:49from it contains a part you know sample
  819. 39:52a sample from subject number twenty but
  820. 39:54also partly a sample from subject 19 18
  821. 39:5817 16 that's that's finance we don't
  822. 40:02have access to clean observations why
  823. 40:04because financial series are multi
  824. 40:08collinear they're the exhibits serial
  825. 40:11correlation they are non normal they are
  826. 40:14all contaminated right there okay there
  827. 40:17is a lot of stuff going on in financial
  828. 40:19markets at any point in time and we can
  829. 40:22never isolate the effect of features its
  830. 40:28everything combined right so there is no
  831. 40:31such thing in finance as collecting a
  832. 40:33sample from a particular individual and
  833. 40:36then collecting an independent sample
  834. 40:38why because the cross correlations are
  835. 40:39tremendous and then to make matters
  836. 40:42worse even the serial correlation is
  837. 40:44substantial now why is this relevant
  838. 40:48well it's relevant because think about
  839. 40:53some of the major breakthroughs in
  840. 40:56machine learning these days right when a
  841. 40:58couple of years ago algorithms were able
  842. 41:01to identify faces very effectively or
  843. 41:05drive cars even though that track record
  844. 41:09has been tarnished recently now when you
  845. 41:14think about it here is my friend Luna my
  846. 41:17friend Luna can recognize faces very
  847. 41:19well I know it because she doesn't bark
  848. 41:21at me she barks at the neighbor however
  849. 41:26even though my dog Luna can recognize
  850. 41:29faces as well as Google's algorithms my
  851. 41:34dog Luna she cannot manage my investment
  852. 41:37portfolio well she can manage my
  853. 41:39investment for Oh more or less as well
  854. 41:41as most or
  855. 41:43managers out there in Water Street but
  856. 41:44that's not exactly what you would expect
  857. 41:46anyway I don't pay her anywhere close
  858. 41:51whatever machine you know a worse
  859. 41:54rapport manager with respect or be
  860. 41:56satisfied with anyway unless they just
  861. 41:57want to get some you know cold meal
  862. 42:02at the end of the day so this is the
  863. 42:05problem right the problem is that what
  864. 42:07appears to be breakthroughs somewhere
  865. 42:10else like driving cars and recognizing
  866. 42:15faces there are plenty of people who can
  867. 42:18drive cars there are plenty of people
  868. 42:20who can recognize faces but there are
  869. 42:24not many people who can manage
  870. 42:26portfolios it happens to be a very
  871. 42:28complex problem and part of the reason
  872. 42:31it is a very complex problem is not
  873. 42:33because the system is chaotic
  874. 42:36there are cardig systems out there that
  875. 42:38can be predicted using machine learning
  876. 42:39if you read the press over the past week
  877. 42:44actually for instance there were a group
  878. 42:46of scientists who were able to predict a
  879. 42:50chaotic system like wide spread or the
  880. 42:52spread of spreading of a wildfire over
  881. 42:56multiple Lyapunov cycles which
  882. 42:59essentially are full cycles of
  883. 43:00uncertainty it's like eight cycles it
  884. 43:02was incredible a machine learning
  885. 43:04algorithm could predict a chaotic system
  886. 43:07this is something that nobody thought it
  887. 43:10would be possible so machine learning
  888. 43:13truly is an incredible tool that can
  889. 43:15solve for card existence like the
  890. 43:18economy but the problem with finance is
  891. 43:22that the data sets are not as good as
  892. 43:24the data sets you can form in physics
  893. 43:26and part of the difficulty is exactly
  894. 43:29what we are discussing in this slide
  895. 43:31right and it is that observations are
  896. 43:34non-unique these observations are not
  897. 43:36independent and identically distributed
  898. 43:38and one thing we can do is to control
  899. 43:43for that lack of uniqueness essentially
  900. 43:45what we can do is we can determine
  901. 43:48whether the observations are similar to
  902. 43:51other service observations we have made
  903. 43:53how well suppose that for instance
  904. 43:57you make you observe some features and
  905. 44:01now you are labeling these features
  906. 44:03based on the outcome that calls over the
  907. 44:06next 20 bars right or or using the
  908. 44:10triple barrier method until one of the
  909. 44:12berries is hit
  910. 44:15now the next observation has some
  911. 44:18overlap information right
  912. 44:19the next observation is going to look at
  913. 44:22the side the next twenty one or twenty
  914. 44:23three bars and there is an overlap and
  915. 44:25you can control for that overlap
  916. 44:27essentially you you can determine what
  917. 44:30is the amount of share information
  918. 44:33between these consecutive observations
  919. 44:36and once you do that something very
  920. 44:38interesting happens and it is that once
  921. 44:41you sample we when you contact your
  922. 44:45cross-validation once you sample
  923. 44:47observations taking into account the
  924. 44:49redundancy the uniqueness of the you
  925. 44:55sample of more observations that are
  926. 44:57more more unique than what of course is
  927. 45:00that all of a sudden your out-of-sample
  928. 45:04accuracy increases dramatically right
  929. 45:08meaning that if you contact across a
  930. 45:10cross-validation and you don't take into
  931. 45:14account the uniqueness of the
  932. 45:16observations your accuracy is not going
  933. 45:18to be as good as if you if you introduce
  934. 45:21that additional information to your
  935. 45:23classifier so that's something that not
  936. 45:25many people do but definitely it has a
  937. 45:28tremendous benefits now since we are
  938. 45:31already talking about cross-validation
  939. 45:33let's discuss one essential problem in
  940. 45:37financial data sets and that's leakage
  941. 45:40this is why one of the reasons many back
  942. 45:45tests look wonderful in sample and then
  943. 45:49you deploy the strategy and it doesn't
  944. 45:51work out the sample so one of the
  945. 45:52reasons is because the machine learning
  946. 45:56algorithm tested something learned
  947. 46:00something in sample and then tested that
  948. 46:04fit those fit parameters out-of-sample
  949. 46:07in in the testing set
  950. 46:10the testing said had leaked information
  951. 46:13into the training set right and how does
  952. 46:17this happen well in finance very often
  953. 46:19why because the series our exhibit
  954. 46:22serial correlation and the labels are
  955. 46:25overlapping and as a result when you
  956. 46:28combine these two features to your
  957. 46:29correlation and overlapping labels very
  958. 46:32often there will be some examples in the
  959. 46:36testing set that are sharing information
  960. 46:39with samples in the training set what
  961. 46:42can you do about it well one thing you
  962. 46:44can do is of course as we said before to
  963. 46:46try to control for the uniqueness of the
  964. 46:49observations but that doesn't suffice I
  965. 46:51think that you need to do is you need to
  966. 46:53you need to perform two operations one
  967. 46:57is called portion and the other one is
  968. 47:02called embargo the difference between
  969. 47:03the two is porting has to do with
  970. 47:06removing from the in-sample observations
  971. 47:11that share information with other
  972. 47:14observations in the in the testing set
  973. 47:20so that's something that we can do
  974. 47:22because we know what is the degree of
  975. 47:25overlap between the labels in the two
  976. 47:28sets and the second thing is embargo
  977. 47:30essentially this is necessary when
  978. 47:33you're testing set predates the training
  979. 47:38set so for instance here as you can see
  980. 47:40the testing set is between two training
  981. 47:43sets one that happens before one that
  982. 47:44happens afterwards and you need to
  983. 47:47remove that overlap which is what
  984. 47:49purlins does but in addition on the
  985. 47:51right side there are some observations
  986. 47:53in the training set that are after the
  987. 47:58testing set and they should be removed
  988. 48:01once you do that what happens is that
  989. 48:05well typically Sharpe ratios decline in
  990. 48:08the practice because that's what should
  991. 48:10happen essentially you are removing the
  992. 48:12effects of overfitting of leakage and by
  993. 48:17the way one thing to determine what at
  994. 48:20what point you have purged an embargoed
  995. 48:23enough is
  996. 48:23when the sharp stabilizes and it ceases
  997. 48:26to decline hopefully about zero all
  998. 48:31right people number seven last one my
  999. 48:35favorite back to sober feeling and this
  1000. 48:39is what I call the most important flood
  1001. 48:41in finance I call it I call it that way
  1002. 48:44because it has helped me a lot during my
  1003. 48:48career essentially the way these plot is
  1004. 48:51generated is as follows suppose that you
  1005. 48:54perform a number of experiments say a
  1006. 48:56thousand you perform a thousand of
  1007. 48:59practice and these Baptists are trying
  1008. 49:04to determine the profitability of
  1009. 49:05various strategies whether their mean
  1010. 49:07reversion trend-following looking for
  1011. 49:10calendar patterns machine learning you
  1012. 49:12name it they are trying to identify a
  1013. 49:15strategy and compute the performance of
  1014. 49:17that strategy now the the feature where
  1015. 49:24do where do these series you are using
  1016. 49:29for developing this strategy where do
  1017. 49:30they come from well suppose that these
  1018. 49:32series are actually random walks they
  1019. 49:34are unpredictable
  1020. 49:35so essentially what we are doing is we
  1021. 49:38are just computing investment strategies
  1022. 49:40on series where by definition there is
  1023. 49:44no investment strategy they are just
  1024. 49:46unpredictable what is the Sharpe ratio
  1025. 49:50that you expect to achieve surprisingly
  1026. 49:52the answer is not zero right when you
  1027. 49:55conduct when you contact a thousand
  1028. 49:58experiments on a on a series on a single
  1029. 50:05series where the series is unpredictable
  1030. 50:08they expected maximum Sharpe ratio is
  1031. 50:12around three isn't that astonishing
  1032. 50:17remember the series is unpredictable
  1033. 50:19there is no strategy and yet they
  1034. 50:22expected maximum Sharpe ratio is three
  1035. 50:27well if you conduct a million
  1036. 50:30simulations where you know today to
  1037. 50:32perform in a simulation this trivial
  1038. 50:34impact is now the sharp respect
  1039. 50:37maksimka ratio is 5 and what this sells
  1040. 50:42is the following whenever you read the
  1041. 50:46paper in the journal of finance in any
  1042. 50:48of the best journals anywhere how many
  1043. 50:54trials did they offer conduct nobody
  1044. 50:59knows
  1045. 51:01most likely the author doesn't know
  1046. 51:03because he didn't keep track of them
  1047. 51:05some of these papers are written over
  1048. 51:08many years the referees had no clue and
  1049. 51:15everybody assumed in their statistical
  1050. 51:18tests that a single trial had taken
  1051. 51:21place essentially that's what happens
  1052. 51:23when we utilize a confidence level of
  1053. 51:2695% a significance level of 5% we set
  1054. 51:29the thresholds for rejecting the new at
  1055. 51:33the 5% probability of a false positive
  1056. 51:37under the assumption that a single trial
  1057. 51:39has taken place now this is something
  1058. 51:42that it has been known for a long time
  1059. 51:44right already four or five years after
  1060. 51:49the current framework for conducting
  1061. 51:54statistical tests was set up people
  1062. 51:59realize that these thresholds for
  1063. 52:02rejecting the null couldn't be remain
  1064. 52:05constant as you conduct multiple tests
  1065. 52:09so for the past 90 years people have
  1066. 52:14been conducting finance people have been
  1067. 52:16conducting multiple tests without
  1068. 52:17adjusting for the rejection thresholds
  1069. 52:20so this is something that doesn't happen
  1070. 52:24anywhere else right in medical research
  1071. 52:26in physics people conduct multiple tests
  1072. 52:30and they all adjust for this phenomenon
  1073. 52:33the possibility that false positives
  1074. 52:36appear more frequent as a result of
  1075. 52:38multiple testing this is why a couple of
  1076. 52:42years ago a friend of mine cam Harvey
  1077. 52:46who also is a president of the American
  1078. 52:48Finance Association published
  1079. 52:50paper with this shocking conclusion most
  1080. 52:53discoveries in finance are false it's
  1081. 52:58just a matter of nobody is controlling
  1082. 53:01for the number of trials so you said
  1083. 53:02nobody even knows how many trials are
  1084. 53:04taking place now when it comes to a
  1085. 53:07strategy development is something that
  1086. 53:09we need to keep always in mind we will
  1087. 53:12always find profitable strategies even
  1088. 53:17where there are none it's just a matter
  1089. 53:20of trying and trying trying and I guess
  1090. 53:24some people express this thought in the
  1091. 53:28following ways if you torture the data
  1092. 53:31hard enough eventually the data will
  1093. 53:34confess whatever you want and this is
  1094. 53:38the application to strategy development
  1095. 53:41what can we do about it well this is the
  1096. 53:45false strategy theorem is is a theorem
  1097. 53:48that some colleagues and I prove in 2014
  1098. 53:52essentially what it determines is this -
  1099. 53:55line this - line the this - line is the
  1100. 53:59result of that theorem and this kind of
  1101. 54:04heat map is the experimental
  1102. 54:08verification right experimental
  1103. 54:09verification if you generate random
  1104. 54:12strategies and you compute X the
  1105. 54:14expected maximum Sharpe ratio they
  1106. 54:16actually they maximal Sharpe ratio you
  1107. 54:18obtain this distribution and this dashed
  1108. 54:20line is what the theorem had predicted
  1109. 54:21and as you can see the theorem is very
  1110. 54:25accurate for a very different very wide
  1111. 54:28range of number of trials actually it
  1112. 54:31becomes even more accurate as the number
  1113. 54:34of trials increases and what is the
  1114. 54:38conclusion of this theorem that
  1115. 54:39essentially there are two variables that
  1116. 54:41are never reported in academic journals
  1117. 54:44that are critical to determine whether a
  1118. 54:48discovery is true or false and these two
  1119. 54:51variables are number one the number of
  1120. 54:52trials please if you ever find a paper
  1121. 54:56in any academic journal that in finance
  1122. 54:59that says and I conducted two hundred
  1123. 55:02twenty three trials please
  1124. 55:04tell me because it will be the first
  1125. 55:05time that anybody ever reports the
  1126. 55:08number of trials number two the second
  1127. 55:14variable that is that is very critical
  1128. 55:16to discount for the probability of a
  1129. 55:21false positive is the variance of the
  1130. 55:24outcomes right why is this relevant well
  1131. 55:27if you are conducting research that
  1132. 55:30involves stratus let's say coming from
  1133. 55:35technical analysis or counting sore
  1134. 55:42spots or something you know when were
  1135. 55:45using any sort of variable or intuition
  1136. 55:49to make a prediction the variance of the
  1137. 55:51outcomes is likely to be very wide so
  1138. 55:54essentially it would be it becomes all
  1139. 55:56of a sudden very likely that you will
  1140. 55:58obtain a strata with a very high ratio
  1141. 56:00now when you conduct a strategy research
  1142. 56:05where you stick to a model right you
  1143. 56:08stick to some pre-ordained notion of how
  1144. 56:12the world works now the variance is
  1145. 56:16going to be much smaller right because
  1146. 56:17your degrees of freedom are shrunk right
  1147. 56:19so that's something that is these are
  1148. 56:23essentially the two variables that are
  1149. 56:26critical to determine whether if this
  1150. 56:28positive whether it discoveries is a
  1151. 56:30true discovery or false discovery and
  1152. 56:32they are never reported well when you
  1153. 56:36are conducting your research you can
  1154. 56:37always keep track of these variables
  1155. 56:39right essentially what you do is and
  1156. 56:42that's something that my team does
  1157. 56:44whenever someone conducts a practice the
  1158. 56:49system automatically loves information
  1159. 56:51about that practice
  1160. 56:52you know whenever you have access to
  1161. 56:54information the research is going to be
  1162. 56:57penalized for accessing that information
  1163. 56:59multiple times and eventually someone
  1164. 57:02will arrive at my office and say Marcos
  1165. 57:05we encounter in country Australia with
  1166. 57:07the Sharpe ratio of two and I will look
  1167. 57:09to the logs and say hey but you know you
  1168. 57:11access the data sets like five hundred
  1169. 57:13times I was affecting a Sharpe ratio of
  1170. 57:15five and come back when you have
  1171. 57:18average of five - doesn't excite me and
  1172. 57:21then he will come back with sharpish of
  1173. 57:24five and probably he will have conducted
  1174. 57:2610,000 experiments and at some point in
  1175. 57:29time it's good to give up at some time
  1176. 57:32at some point then people should
  1177. 57:33actually give up because remember you
  1178. 57:36will achieve any Sharpe ratio you want
  1179. 57:38ten twenty hundred hundred shirisha no
  1180. 57:40problem is just a matter of trials and
  1181. 57:43patience even though there is no
  1182. 57:46strategy there so what can we do about
  1183. 57:48it well we can compute the deflated
  1184. 57:50Sharpe ratio and the deflated Sharpe
  1185. 57:52ratio is a metric that takes into
  1186. 57:54account the number of trials whether the
  1187. 57:58distribution of the returns is skewed
  1188. 58:01exhibits kurtosis it takes into account
  1189. 58:03the sample length it takes into account
  1190. 58:05all these features that are very
  1191. 58:07relevant but in particular it takes into
  1192. 58:10account these SR zip zero this variable
  1193. 58:15that incorporates what is expected chart
  1194. 58:17ratio under multiple trials and we take
  1195. 58:21into account the variance of the
  1196. 58:22experiments now a couple of days ago a
  1197. 58:28colleague of mine and I published a
  1198. 58:31paper titled detection of false
  1199. 58:34strategies that explains a procedure for
  1200. 58:39estimating these two variables very
  1201. 58:43accurately so essentially what we have
  1202. 58:46done is this paper will will show you
  1203. 58:49how you can determine whether the
  1204. 58:51strategy you have computed would you
  1205. 58:54have identified is it true positive or a
  1206. 58:57false positive and as you can see in the
  1207. 58:59paper we have estimated the the efficacy
  1208. 59:05of the method by running millions of
  1209. 59:08Monte Carlo simulations and the method
  1210. 59:11seems to be very precise essentially
  1211. 59:14let's say that you come up with a
  1212. 59:15strategy with a sharp edge of two and
  1213. 59:18the the paper will teach you how to
  1214. 59:22estimate the number of independent
  1215. 59:24trials that have taken place which is in
  1216. 59:28most cases much smaller than the number
  1217. 59:31of actual
  1218. 59:32the difference between actual tralala an
  1219. 59:34independent trial independent trials
  1220. 59:36typically are much less than number of
  1221. 59:38trials and also it will teach you how to
  1222. 59:42cluster your trials in a way that you
  1223. 59:45can compute the variance between those
  1224. 59:46independent trials and once you plug in
  1225. 59:49these two variables you will have an
  1226. 59:54accurate representation of whether this
  1227. 59:56strategy is something you should be
  1228. 59:57investing in or not is this a
  1229. 59:59statistical fluke this is the result of
  1230. 1:00:02lack or is this a strategy that performs
  1231. 1:00:06much better than one what anybody
  1232. 1:00:08Buddhist pegged they are sort of like
  1233. 1:00:11and with that I conclude my remarks
  1234. 1:00:13thank you again for your attention
  1235. 1:00:16please go ahead and ask me any questions
  1236. 1:00:19[Applause]
  1237. 1:00:28yes definitely
  1238. 1:00:42they're doing a great job and in fact we
  1239. 1:00:45have for the past three years we have
  1240. 1:00:47been writing papers where we are
  1241. 1:00:51ignoring each other for the word that
  1242. 1:00:53they are doing the work we are doing we
  1243. 1:00:54are on the same page look I think we
  1244. 1:00:59both recognize that it is very
  1245. 1:01:01suspicious than in finance the rate of
  1246. 1:01:06withdrawal of papers right the rate at
  1247. 1:01:10which papers are recalled is essentially
  1248. 1:01:14zero whenever whatever whenever a paper
  1249. 1:01:17in finance is published most likely it
  1250. 1:01:20will never be revisited and that's
  1251. 1:01:24unheard in science right in medical
  1252. 1:01:27research that with Robo rate can be as
  1253. 1:01:31high as 20% in some journals meaning
  1254. 1:01:33that the paper camp comes out and ten
  1255. 1:01:35years later someone realizes well you
  1256. 1:01:40know new evidence challenges what was
  1257. 1:01:43published ten years ago and the paper is
  1258. 1:01:46erased it disappears from the journal
  1259. 1:01:49right it's no longer listed there and
  1260. 1:01:52probably finance and theology or the the
  1261. 1:01:55last two fields where papers are never
  1262. 1:01:59recalled and hopefully you know cam has
  1263. 1:02:03been a leader a thought leader on this
  1264. 1:02:05respect that this must change
  1265. 1:02:08Thanks yes yes
  1266. 1:02:17so suppose that you have a series that
  1267. 1:02:20is serially correlated right and so
  1268. 1:02:25that's what you can see there in that is
  1269. 1:02:26in that in the middle of the slide XT is
  1270. 1:02:29approximately the same as XT plus 1 this
  1271. 1:02:32is the serial correlated you make an
  1272. 1:02:33observation and the next observation is
  1273. 1:02:37very similar and at the same time the
  1274. 1:02:41levels are overlapping the label that is
  1275. 1:02:47associated with observation t shares a
  1276. 1:02:50lot of information with the label
  1277. 1:02:51associated with t plus 1 now if T and T
  1278. 1:02:54plus 1 fall in different sets let's say
  1279. 1:02:57that T belongs to the training set and T
  1280. 1:02:59plus 1 falls in the testing set now the
  1281. 1:03:04algorithm will learn in the testing set
  1282. 1:03:07something that should only belong in the
  1283. 1:03:09training set right and here what should
  1284. 1:03:12happen is that observation T should be
  1285. 1:03:15removed from the from the test from the
  1286. 1:03:19training set so the algorithm should not
  1287. 1:03:20be allowed to learn from something that
  1288. 1:03:23is going to be used to evaluate the
  1289. 1:03:25efficacy of the fit yep go ahead
  1290. 1:03:43yes the so the question is what is the
  1291. 1:03:45key attribute of success of a machine
  1292. 1:03:48learning astrati well I think it has to
  1293. 1:03:52do with number one the quality and and
  1294. 1:03:57uniqueness of your data right you want
  1295. 1:03:59to model strategies after data that is
  1296. 1:04:02very hard to get not many people have
  1297. 1:04:06perhaps they are data center are very
  1298. 1:04:10hard to manipulate I know that I'm after
  1299. 1:04:12after something when my data team
  1300. 1:04:15complains right that's when my data team
  1301. 1:04:18complains this data set is unbearable
  1302. 1:04:20that I probably you know it's like going
  1303. 1:04:24to strike gold in Alaska right where is
  1304. 1:04:27their goal in the last quarter what's
  1305. 1:04:28going on because nobody wanted to go to
  1306. 1:04:30Alaska right so this is a data set that
  1307. 1:04:32is that is intractable it's very hard to
  1308. 1:04:35do process so that's one thing right
  1309. 1:04:39another thing is to come up with good
  1310. 1:04:43feature importance methods and that's
  1311. 1:04:46something that you can see in the book
  1312. 1:04:48there is a full chapter dedicated to
  1313. 1:04:50feature importance why because research
  1314. 1:04:53as it relates to financial markets
  1315. 1:04:56back-testing is not a research tool and
  1316. 1:04:59I know that that's a a polemic statement
  1317. 1:05:03many people believe that a Baptist is
  1318. 1:05:06what should confirm or unconfirmed
  1319. 1:05:10a particular statement or strategy but
  1320. 1:05:14then we are is once you are in the back
  1321. 1:05:15testing mode research is already it's
  1322. 1:05:18already finished you you cannot learn
  1323. 1:05:20what something from a Bacchus and then
  1324. 1:05:22reutilize if you realize it well you
  1325. 1:05:24know you better keep control of the
  1326. 1:05:26number of trials right and and then you
  1327. 1:05:28will have to deflate the Sharpe ratio by
  1328. 1:05:32the probability that this is a lucky
  1329. 1:05:35discovering the typically what you want
  1330. 1:05:38to do is you want to spend a lot of time
  1331. 1:05:41identifying what are the features that
  1332. 1:05:43are important for that strategy and once
  1333. 1:05:47you come up with important features now
  1334. 1:05:49you're going to build a strategy and at
  1335. 1:05:50the last moment you're going to back
  1336. 1:05:52test and
  1337. 1:05:54you don't you really do not want to go
  1338. 1:05:57into this cycle until eventually the
  1339. 1:05:59data confesses whatever you wanted the
  1340. 1:06:02data to confess you want to spend most
  1341. 1:06:04of your time in feature importance one
  1342. 1:06:10more
  1343. 1:06:36[Music]
  1344. 1:06:39yep
  1345. 1:07:10well let's let's think a little bit
  1346. 1:07:14about that it has to do a lot about how
  1347. 1:07:17you process that data right you can
  1348. 1:07:20distract a steal a lot of information
  1349. 1:07:22from data sets that people have access
  1350. 1:07:25to the ideal in the ideal scenario you
  1351. 1:07:27have access to data set that is unpatch
  1352. 1:07:29and nobody has it but that doesn't mean
  1353. 1:07:31that that's the only way of developing
  1354. 1:07:33strategies you can work with data sets
  1355. 1:07:36that people have been working on for a
  1356. 1:07:38long time and yet uncover strategies why
  1357. 1:07:41because you are not using return since
  1358. 1:07:43the Revolution returns you're going to
  1359. 1:07:45use fractional differentiation and
  1360. 1:07:46you're going to come up with a theory
  1361. 1:07:50before applying machine learning let me
  1362. 1:07:53let me give you an example brief example
  1363. 1:07:55suppose that many people in finance
  1364. 1:08:00think that machine learning is a black
  1365. 1:08:02box and every time I feel that I I'd
  1366. 1:08:04roll my eyes because machine learning is
  1367. 1:08:07not a black box you can use it as a
  1368. 1:08:09black box but you can use that the black
  1369. 1:08:11box anything anything you want there is
  1370. 1:08:14a way of using machine learning in a way
  1371. 1:08:16that is not a black box
  1372. 1:08:17it's a white box and the way is the
  1373. 1:08:19following suppose that you are given
  1374. 1:08:24some variables and you know you are put
  1375. 1:08:29in the same position as Sir Isaac Newton
  1376. 1:08:33when he had to come up with his equation
  1377. 1:08:36for gravitational force so you're given
  1378. 1:08:39this series and and you have you know
  1379. 1:08:42some some series are related to the mass
  1380. 1:08:45of the objects the density of the
  1381. 1:08:47objects the reflectivity you know their
  1382. 1:08:52their dimensions with their shape the
  1383. 1:08:56distance between objects right there are
  1384. 1:08:58a bunch of variables and now you run all
  1385. 1:09:00these variables through machine learning
  1386. 1:09:01algorithm and the machine learning
  1387. 1:09:03algorithm comes back with the following
  1388. 1:09:04answer well there are really really
  1389. 1:09:06three variables that are important here
  1390. 1:09:08one is the mass of object one mass of
  1391. 1:09:10object to and the distance between the
  1392. 1:09:11objects and all the rest is rubbish is
  1393. 1:09:13relevant all right now
  1394. 1:09:17Sir Isaac Newton would tell you ha
  1395. 1:09:19that's very interesting I would never
  1396. 1:09:21figure that out now what is the equation
  1397. 1:09:25what is the equation that relates these
  1398. 1:09:27these three magnitudes and the answer is
  1399. 1:09:29well you know does the funny thing about
  1400. 1:09:31machine learning it doesn't tell us the
  1401. 1:09:34equation it doesn't tell us the theory
  1402. 1:09:35we just tell us that these three
  1403. 1:09:38variables are very relevant now the way
  1404. 1:09:42I like using machine learning is machine
  1405. 1:09:47learning as a research tool it tells me
  1406. 1:09:49what are the relevant variables and now
  1407. 1:09:51I have to come up with a theory that is
  1408. 1:09:55going to combine that information into
  1409. 1:09:56in order to make a prediction so to come
  1410. 1:10:00back to your to your question I'm not
  1411. 1:10:02super swated that the only way is to
  1412. 1:10:06utilize rare data sets sometimes you can
  1413. 1:10:09use data sets that people utilize but
  1414. 1:10:13you actually are going to learn and
  1415. 1:10:14you're not going to use these machine
  1416. 1:10:16learning methods as a black box you are
  1417. 1:10:18actually trying you will try to make
  1418. 1:10:20sense of this data in order to come up
  1419. 1:10:22with an explanation of what's going on
  1420. 1:10:24so that's an example in addition to
  1421. 1:10:26using fractional differentiation using a
  1422. 1:10:30better sampling methods better labeling
  1423. 1:10:32methods and so on and so forth there is
  1424. 1:10:34a lot you can do with standard data sets
  1425. 1:10:39yep
  1426. 1:10:52so you have this deflated stop ratio yes
  1427. 1:10:56and can use that to tell us that which
  1428. 1:10:59machine learning algorithm is better
  1429. 1:11:01than the other one you have a do you
  1430. 1:11:04have a comfort yes and also can you tell
  1431. 1:11:07us intuitively how you use the deeply
  1432. 1:11:10Sharpe ratio to tell us which one is
  1433. 1:11:13false positive yes so there is the idea
  1434. 1:11:16the deflected sharpen issues to take
  1435. 1:11:18into account information of whether this
  1436. 1:11:21is a Lackey discovering right and as you
  1437. 1:11:25saw in the in in the this volcanic plot
  1438. 1:11:27that I had there that looks like an
  1439. 1:11:30eruption but it's not this heat map it
  1440. 1:11:33you can target any sort of shot ratio
  1441. 1:11:36that you want the question is once you
  1442. 1:11:38once you have achieve a particular shot
  1443. 1:11:40ratio it is something that you should
  1444. 1:11:42expect just out of lack randomness and
  1445. 1:11:45and that's what they deflate the
  1446. 1:11:47Charbagh should does so in the in the
  1447. 1:11:49course of your research you should take
  1448. 1:11:51you should keep track of the number of
  1449. 1:11:53experiments right essentially what you
  1450. 1:11:54would do is you would collect all the
  1451. 1:11:56returns all the time series of returns
  1452. 1:11:58that you obtain from every Baptist this
  1453. 1:12:00is you can DAC I handed back this now
  1454. 1:12:02you're going to have a T by 100
  1455. 1:12:05matrix where T is the number of returns
  1456. 1:12:07per practice and now you are going to
  1457. 1:12:10use that information to determine the
  1458. 1:12:13number of independent factors that you
  1459. 1:12:15have actually conducted and that's
  1460. 1:12:17something that you can read in the paper
  1461. 1:12:18that I Parrish last Monday so that's the
  1462. 1:12:21way to extract this number here in this
  1463. 1:12:26equation K and the way I use this and my
  1464. 1:12:31team uses this is that people conduct
  1465. 1:12:34all these factors and we know that
  1466. 1:12:36eventually we are always going to come
  1467. 1:12:38back routinely with false positives
  1468. 1:12:41right what we need to be very careful
  1469. 1:12:43about is when we are doing a strategy on
  1470. 1:12:45any particular data set whether we have
  1471. 1:12:50exhausted our lack essentially we are
  1472. 1:12:53now we are so unlikely that we have made
  1473. 1:12:55a lucky discovery and that's what we
  1474. 1:12:58need to keep track of
  1475. 1:12:59and that's that's one way that for
  1476. 1:13:02instance this community could cooperate
  1477. 1:13:04you you don't know how many experiments
  1478. 1:13:06someone is conducting on the same
  1479. 1:13:08dataset you're conducting other
  1480. 1:13:10experiments but here is kwan talkin that
  1481. 1:13:12is able to keep track of all the
  1482. 1:13:13experiments so that would be one
  1483. 1:13:14possible application thank you very much
  1484. 1:13:25thank you that's great

About this transcript

This page contains the full transcript of The 7 Reasons Most Machine Learning Funds Fail Marcos Lopez de Prado from QuantCon 2018 by Quantopian, generated from the public captions YouTube serves with the video. The transcript has 10,001 words across 1,484 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.