So what advice does Buffett have for the rest of us mere mortals, individual investors as well as institutional investors?

His answer is quite arresting: Invest mainly in

Continue reading Investment advice from the world’s most successful stock picker

]]>So what advice does Buffett have for the rest of us mere mortals, individual investors as well as institutional investors?

His answer is quite arresting: Invest mainly in broad-market index-tracking funds with very low fees.

In his 2017 letter to stockholders, released 25 February 2017, Buffett mentioned a bet he made nearly 10 years ago, where he challenged an asset manager for the hedge fund Protege Partners that a low-cost S&P 500 index-tracking fund would outperform a basket of hedge funds. In his letter, Buffett provided an update: the basket of hedge funds had average compound annual returns of 2.2% through 2016; the index fund has returned 7.1%, more than three times as much.

Buffett’s bet, which he almost certainly will win, ends on 31 December 2017. He has promised that his winnings will be donated to charity.

Buffett points his finger at the large fees assessed by the hedge funds — he estimates that approximately 60% of the gains achieved by the hedge funds were lost to management fees over the past ten years. He writes, “When trillions of dollars are managed by Wall Streeters charging high fees, it will usually be the managers who reap outsized profits, not the clients.” He added “Both large and small investors should stick with low-cost index funds.”

Buffett recently calculated that over the past ten years, wealthy investors, pension funds and other institutional investors have lost roughly USD$100 billion to fees charged by hedge funds and other high-fee investment vehicles. He adds, “my calculation of the aggregate shortfall is conservative.”

Buffett also emphasized that these high fees have consequences:

Much of the financial damage befell pension funds for public employees. … Many of these funds are woefully underfunded, in part because they have suffered a double whammy: poor investment performance accompanied by huge fees. The resulting shortfalls in their assets will for decades have to be made up by local taxpayers.

Buffett continued by heaping praise on Jack Bogle, the founder of Vanguard Group, which pioneered very low-cost index-fund investment.

Along this line, Buffett clearly practices what he preaches, at least for that portion of his personal fortune that is to be inherited by his wife and heirs. He has instructed the trustee of his estate, after he dies, to invest at least 90% of the money in low-cost S&P 500 index-tracking funds, and the remainder in government bonds.

One question that is frequently raised is whether a large-scale movement to passive indexed investing would threaten the health of the system.

There are certainly some legitimate grounds for concern here. After all, the investing world will always require at least some investors who address fundamentals, who read quarterly reports and who continually reassess the value of a particular firm’s stock and bond offerings in light of current news, both about the firm itself and also the ever-changing landscape of economic environment and competitors in the firm’s sector. Clearly if 90% or more of a market were passively indexed, that market would be quite unstable, subject to wrenching volatility when, for example, some trader accidentally sells far too many shares, as in the 2010 flash crash. Even, say, 70% would be cause for concern.

However, we are still quite some distance from this level of passive investment. A December 2014 tabulation of U.S. market data found a total equity capitalization of USD$21.7 trillion, of which USD$2.6 trillion, or 12.1% was passively indexed. So U.S. equity markets have a long ways to go before passive investment becomes a significant stability issue. European and Asian markets are even further from the level of concern.

As we have pointed out in several previous blogs (see, for example, Blog A and Blog B), we should not be terribly surprised at the fact that even the best hedge funds and other highly professional investment organizations have difficulty consistently beating the market. Since markets by definition incorporate the collective judgments of many thousands of participants worldwide, including quite a few organizations who employ very sophisticated mathematical algorithms and high-frequency trading software (often canceling out each others’ efforts), it follows that equity markets are reduced to time series that exhibit many of the statistical characteristics of a random walk (including unpredictability).

A few organizations, such as the Renaissance Medallion Fund, and a few individual managers, such as Warren Buffet, have indeed been able to beat the market averages over a sustained period of time. But replicating this success is, by definition, very difficult, and even more difficult to prove statistically.

According to an ancient account, when Pharaoh Ptolemy I of Egypt grew frustrated at the degree of effort required to master geometry, he asked his tutor Euclid whether there was some easier path. Euclid is reputed to have replied, “There is no royal road to geometry.” Indeed. And there is no royal road to investment either.

]]>The basic idea behind smart beta is to observe that traditional capitalization-weighted investments (such as S&P 500 index funds) tend to be heavily weighted in favor of securities from large, stable firms. Thus the smart beta community

Continue reading Backtest overfitting in smart beta investments

]]>In the past few years “smart beta” (also known as “alternative beta” or “strategic beta”) investments have grown rapidly in popularity. As of the current date (January 2017), assets in these investment categories have grown to over USD$500 billion, and are expected to reach USD$1 trillion by 2020. More than 844 exchange-traded funds employing a smart beta strategy are now in operation.

The basic idea behind smart beta is to observe that traditional capitalization-weighted investments (such as S&P 500 index funds) tend to be heavily weighted in favor of securities from large, stable firms. Thus the smart beta community believes that by adopting a different weighting system, such as one that magnifies smaller, higher-risk securities, one can achieve superior long-term growth. The smart beta movement had its roots in tests of the efficient market hypothesis in the academic finance community during the 1970s, 1980s and 1990s.

The general “smart beta” philosophy encompasses many specific strategies. If one invests equally, say, in a S&P500 index fund and a mid-cap or small-cap index fund, one is using a “smart beta” strategy, by this definition. One of the earliest commercial smart beta funds assigned all S&P 500 index components equal weights. Today, the smart beta world encompasses a diverse range of strategies, ranging from novel systems of weights to systematic trading algorithms, derivatives and multi-asset investments.

Even within the realm of weighting-based smart beta strategies, there are numerous variations, as given in the following taxonomy:

*Return-oriented*: Dividend-screened, dividend-weighted, value, growth, fundamentals, multi-factor, size, momentum, buyback/shareholder yield, earnings weighted, quality, expected returns or revenue weighted.*Risk-oriented*: Minimum volatility/variance, low/high beta or risk-weighted.*Other*: Non-traditional commodity, equal-weighted, non-traditional fixed income or multi-asset.

Many are concerned, however, that the original concept of “smart beta” has been extended to such a large collection of sophisticated strategies that the simplicity and elegance of the original concept has been lost. What’s more, as the complexity of these strategies has increased, so has the likelihood that they will suffer from (or be invalidated by) backtest overfitting.

By backtest overfitting here, we mean the usage of historical market data to develop an investment strategy, where many parameter variations (quite possibly millions or billions of variations) have been searched by computer to find an optimal strategy. The present authors, among others, have developed statistical tests to help one avoid backtest overfitting; see, for example, our paper on the deflated Sharpe ratio, which corrects for two leading sources of performance inflation, namely selection bias under multiple testing and non-normally distributed returns.

A new paper on the topic of backtest overfitting in smart beta strategies has appeared in the Journal of Portfolio Management (see also preprint).

These authors (Antti Suhonen, Matthias Lennkh and Fabrice Perez) began with a database of approximately 3000 alternative beta strategies, from which they selected 215 unique strategies with sufficient data for their analysis. The average backtest period of their test set was 10.7 years, and the average live operation time was 4.6 years. These 215 strategies included commodity, equity, fixed income, foreign exchange and multi-asset schemes.

Among their tabulated statistics is the Sharpe ratio of the strategy during the backtest period, the Sharpe ratio during the live period and the “realized haircut” — the percentage reduction in Sharpe ratio between the backtest and the live periods. Over all tested strategies, they found a surprisingly large median haircut of 72%; for equity strategies it was 80%. It is also notable that only 18 of the 215 strategies had a live Sharpe ratio greater than the backtest Sharpe ratio; 65 of the 215 strategies had a negative Sharpe ratio over the live period.

Suhonen, Lennkh and Perez recognized that given the 2008-2009 worldwide market crash, their results might be dismissed as an artifact of that unfortunate episode. But when they restricted their data to just a 3-year pre/post time window, thus avoiding the 2008-2009 period, their results were little changed — the median haircut dropped from 72% to 62% (which is still a very large drop-off), but the same number of strategies as before (65) exhibited a negative Sharpe ratio over the live period.

In another interesting analysis, the Suhonen-Lennkh-Perez paper categorized the 215 strategies by complexity, and then rated their performance accordingly to this categorization. Indeed, as some have previously feared, they found that the more complex strategies suffered larger haircuts — in particular, the most complex strategies suffered 30 percentage points more haircut than the simplest strategies.

The findings on complexity are arguably the most significant of the Suhonen-Lennkh-Perez paper. What they found, in summary, is that while the “smart beta” approach may have some merit for very simple strategies, such as merely balancing a large-cap exchange-traded fund with a mid- or small-cap exchange-traded fund, more sophisticated strategies of this class (which are typically the result of large-scale computer-based searches for an optimal parameter selection) fall prey to backtest overfitting.

These overall results are entirely consistent with the results of a paper by the present authors, which has found that backtest overfitting is remarkably easy to occur in any investment strategy that was designed using computer-based searches over a large parameter space to find an “optimal” design (as is certainly done in many smart beta strategies).

These results are also consistent with an separate paper by the present authors on stock fund weighting schemes. We demonstrated that it is relatively easy to design a stock portfolio, consisting only of weighted S&P 500 index stocks, that will achieve virtually any desired performance profile, based on backtests. Such portfolios, however, typically do much worse on new out-of-sample data, a symptom of serious backtest overfitting.

Backtest overfitting is not a minor flaw. If an overfit strategy is implemented, it may well result in disappointing returns or even catastrophic loss of capital. Thus it behooves all who design such strategies to ensure that their design is not overfit.

]]>For most other hedge funds, it has been a different story, namely year after year of subpar performance. For example, the HFRI Equity Hedge (Total) Index of U.S. equity

Continue reading How much of hedge fund profits are taken by management?

]]>The past few years have been rough on hedge funds. Some have done very well, such as the Medallion Fund, a highly mathematical quant fund operated by Renaissance Technologies. It has produced returns averaging over 30% since its founding in 1988, totaling approximately $55 billion in profits, making multimillionaires of many of its very fortunate investors, who for the most part are professional mathematicians and others employed by Renaissance.

For most other hedge funds, it has been a different story, namely year after year of subpar performance. For example, the HFRI Equity Hedge (Total) Index of U.S. equity hedge funds was up only 4.85% as of the end of November 2016 (from 1 January 2016), with an annualized return over the past 5 years of only 5.15%. This compares to a 12.06% annualized return for the S&P500 index (14.30% with reinvested dividends) over the same five-year period ending 30 November 2016.

Not surprisingly, many hedge fund clients are not happy. In 2014, the California Public Employees’ Retirement System (CalPERS), which is the largest U.S. pension fund, announced that it would completely exit its USD$4 billion investment in hedge funds. In April 2016, the New York City public pension fund announced that it will also exit all hedge fund investments. Finally, in December 2016 the New Jersey Investment Council voted to cut in half its USD$9 billion hedge fund holdings.

In total, over USD$51 billion was withdrawn from U.S. hedge funds over the first nine months of 2016. Similar troubles have beset hedge funds in Europe and Asia.

In the wake of these withdrawals, many hedge funds have closed. In the first quarter of 2016, more U.S. hedge funds were liquidated than started. Tudor Investments, led by billionaire Paul Tudor Jones, laid off 15% of its workforce, in the wake of over USD$2 billion of investor withdrawals. Howard Fischer, head of Basso Capital Management, lamented “It’s miserable, miserable.” George Papamarkakis, head of London’s North Asset Management (which declined roughly 10% in 2016), lamented “There’s gloom everywhere.”

Not surprisingly, hedge fund managers’ woes have elicited little sympathy from clients. As New York City’s Public Advocate Letitia James told members the board, “Let them sell their summer homes and jets, and return those fees to their investors.”

Many are questioning the traditional hedge fund fee structure, typically a “2-20” rule: a 2% annual fee, plus a performance fee of 20% on any profits. These fees are, of course, far higher than the fees typically charged by conventional mutual funds, not to mention the rock-bottom fees of popular index-tracking mutual funds and exchange-traded funds (ETFs). BlackRock’s iShares IEUR ETF, which tracks the MSCI Europe IMI index, charges an annual fee of 0.10%. Vanguard’s VOO ETF, which tracks the S&P500 index, charges 0.05%. Neither ETF has a performance fee.

But as a recent article in the New York Times points out, effective hedge fund fees are often even higher than the 2-20 rule would lead one to believe, due to quirks of accounting. For example, the NY Times article cited a letter to investors by Bill Ackman, who disclosed that in the four years since his Pershing Square Holdings fund was formed, it had gained a total of 20.5% (decidedly mediocre given that the S&P500 gained 67% over this period) before fees, but only 5.7% after fees. In other words, over the four-year period, the fund management kept approximately 72% of the fund’s profits.

The difficulties can be illustrated by considering the fate of a USD$1 million investment in a fund that generates 10% in the first two years, and then loses 5% in the next two years. Before fees, the investment would be USD$1.092 million at the end of the fourth year, for a 9% gain. But after deducting a 20% performance fee in the first two years (and zero performance fee for the last two years), the investment would be at USD$1.053 million, or in other words a total return of just 5.3%.

But even this calculation, which was cited in the New York Times, does not include the 2% annual fee assessed by many hedge funds. If one recalculates the above with a 2% annual fee deducted after each year’s close, then the result is as follows: $1.058 million after year one; $1.119 million after year two, $1.042 million after year three, and $0.970 million after year four. In other words, although the investment gained a profit of 10% before fees, the 2-20 fees erased all gains and left the client with a 3% loss.

In light of these experiences, many, both within and without the hedge fund industry, are questioning the traditional 2-20 fee structure. Some funds have already reduced the 2% annual fee to as low as 0.7%. Others in the industry are arguing that a hedge fund should not assess any fee whatsoever in years that it loses money, and only a minimal fee if it fails to meet its benchmark. One way or another, the hedge fund industry is changing before our eyes.

As we have pointed out in a previous Blog, these results should not come as a surprise. After all, markets by definition incorporate the collective judgments of many thousands of highly trained market analysts worldwide, who employ sophisticated mathematical algorithms running on powerful supercomputers to ferret out any regularities or correlations, and then use high-frequency trading algorithms to act on these phenomena in real time (not to mention millions of other corporate and individuals investors). The efforts of these many players largely cancel each other out, leaving a time series that is little more than a random walk.

It could be argued that some pockets of opportunity existed in the 1980s and 1990s, when computer technologies were scarce and some agents were more informed than others. But in today’s world, those informational asymmetries are largely absent, and so are most of the easily exploitable opportunities. As George Papamarkakis of London’s North Asset Management explains, “There are only so many market inefficiencies out there to profit from.”

Along this line, it should also not come as a surprise that the few remaining hedge funds that do make a respectable gain above the larger markets tend to rely on highly sophisticated mathematical algorithms, along with massive computer databases and processing power. The Renaissance Medallion Fund, mentioned above, reportedly employs very sophisticated techniques, although the details, as one might image, are carefully guarded secrets. A few other funds also do well, but these might be the effect of survivorship and selection bias, rather than management skill.

In any event, let us not be surprised that even relatively sophisticated hedge funds have difficulty achieving consistently above-market returns. After all, they are betting against a signal that is almost entirely random noise, and then charging a premium fee.

]]>A Mathematician’s Apology (1941). G.H. Hardy (1877-1947)

Mathematics as the great equalizerWhat do many of the most successful (and richest) hedge fund managers have in common with a life-long homeless person? That they have worked together, on equal terms, in solving some of the hardest mathematical questions.

Yes, in a stratified world

Continue reading Erdős Numbers: A True “Prince and the Pauper” story

]]>*I still say to myself when I am depressed and find myself forced to listen to pompous and tiresome people: “Well, I have done one thing you could never have done, and that is to have collaborated with Littlewood and Ramanujan on something like equal terms.” *

*A Mathematician’s Apology (1941). **G.H. Hardy (1877-1947)*

What do many of the most successful (and richest) hedge fund managers have in common with a life-long homeless person? That they have worked together, on equal terms, in solving some of the hardest mathematical questions.

Yes, in a stratified world with increasing wealth inequality, gated communities and elite clubs, where the ultra-wealthy rarely interact with the poor, many of the richest people on Earth are mysteriously connected to a vagabond who played a critical role in their careers. But in this story the pauper didn’t want to become a prince. In fact, the pauper methodically donated all the money he ever received for his achievements.

Paul Erdős (1913-1996) was one of the most prolific mathematicians in history. Over his lifetime, he published a staggering 1,525 journal articles and collaborated with 511 colleagues, all without institutional support or holding an academic position. Paul carried two half-empty suitcases around the world, which contained all his earthly possessions. He would stay in a co-author’s house for a few weeks per visit, just enough time to make a new mathematical breakthrough, before moving on to the next fortunate host. One of his mottos was “another roof, another proof.”

*Paul Erdős inspired generations of mathematicians, of all ages. In this 1985 photo, Erdős explains a problem to Terence Tao, who was only 10 years old at the time. Tao received the Fields Medal in 2006*

Paul Erdős made important contributions to a wide range of subjects, and was awarded the prestigious Wolf Prize (1983/84) among a long list of honors. However his place in mathematical history is well secured for another exceptional reason. His most important “proof” is perhaps that mathematicians can work effectively through vast collaboration networks. Until recently, mathematics was essentially a “lone wolf” quest. Collaboration was rare, and authors tended to hide zealously their discoveries until they were ripe for publication (think of Newton and Leibniz). Today, mathematicians are interconnected, coordinate efforts and borrow ideas from each other, sometimes devoting hundreds of brains to proving the same conjecture. Can dozens of good mathematicians work together like a great one? Surprisingly, the answer is yes! Visit the Polymath project for astonishing examples of discoveries involving hundreds of co-authors.

Erdős was involved in so many different mathematical endeavors, that some colleagues humorously wondered, who is not somehow working with him? Hence the idea of “Erdős number” (E#) was born. E# is the length of the shortest collaboration path between a mathematical author and Erdős. If David has co-authored a paper with Erdős, David has E#1. If Mark has co-authored a paper with David, Mark has E#2 (or E#1, if Mark co-authored directly with Erdős), and so on. If there is no collaboration path between Peter and Erdős, Peter’s E# is infinite. The American Mathematical Society offers a free online tool that computes E#, and Oakland University’s Erdős Number Project hosts a wealth of resources.

This notion of E# first started in the year 1969 as a tribute to Paul Erdős by colleagues and friends, without envisioning it as a research tool. However, over the decades academic studies on E# distributions have found interesting features about how mathematical discoveries take place. Out of the ~401,000 mathematical authors (since the 1930s) listed in MathSciNet, over 67% have a finite E#. Being listed in that authors’ catalog is in itself an achievement, because it means that the researcher made a mathematical discovery that was peer-reviewed and published in a journal indexed by MathSciNet. Also, note that ~401,000 authors over roughly 90 years is a relatively small number, considering the millions of people who receive a STEM degree *every year*. The median E# across these accomplished mathematicians is 5, with an upper bound of 13. Every winner of the Fields Medal has a finite E#, with a median of 3, a statistically significant divergence from the overall population. Every winner of the Abel Prize has a finite E#, with a median of 3 and an average of 2.94. Every winner of the Nevanlinna Prize has a finite E#, with a median of 2 and an average of 2.4.

About 80% of Nobel Laureates in Physics also have finite E#, including Albert Einstein (E#2), Enrico Fermi (E#3), Wolfgang Pauli (E#3), Max Born (E#3), Richard Feynman (E#3), Hans Bethe (E#3), etc. Srinivasa Ramanujan has an E#3, albeit Erdős was only 7 years old when the Indian genius tragically died. That is because G.H. Hardy, Ramanujan’s mentor and co-author, has an E#2. Good mathematicians tend to collaborate with other good mathematicians. Like in sports, the better a “player” becomes, the more he is pursued by colleagues who want him to join an existing team, and work together on a challenging problem. Strong teams do not chase weak players, and strong players do not join weak teams. As the collaboration network becomes denser around great mathematicians, the chances to connect with the center (E#0) grow dramatically.

*Good mathematicians tend to work with other good mathematicians. There is often a collaboration path between any two great mathematicians, regardless of age, nationality, ethnicity or social background… even spanning centuries. The figure above shows a path connecting Sir Andrew J. Wiles (E#3) with Ramanujan (E#3), through an all-star sequence of Fields medalists and Fellows of the Royal Society*

Does this mean that E# measures mathematical prowess? Not necessarily. If we search hard enough, we may find highly-cited mathematicians who have made breakthroughs on their own. It is fair to say that E# measures a combination of these two ingredients: *Proficiency *and* collaborative skills*. A skillful mathematician working alone will have an infinite E#, and a very social but mediocre mathematician will have a hard time publishing in a MathSciNet-indexed journal, plus finding co-authors in the proximity of Paul Erdős.

A large portion of the most successful investment funds in history are led by mathematicians. Many of those “quant” firms have been either founded or managed by mathematicians with low E#. The following table provides an incomplete list.

Name |
Firm |
Position |
E# |

Elwyn R. Berlekamp | Axcom Trading Advisors | President | 2 |

Peter J. Weinberger | Renaissance Technologies | Managing Director | 2 |

James B. Ax | Axcom Trading Advisors | Founder, CEO | 3 |

Leonard E. Baum | Axcom Trading Advisors | Chief Scientist, Founder | 3 |

Jean-Philippe Bouchaud | Capital Fund Management | Chairman | 3 |

James H. Simons | Renaissance Technologies | Founder, CEO | 3 |

Vincent Della Pietra | Renaissance Technologies | Managing Director | 3 |

Glen T. Whitney | Renaissance Technologies | Managing Director | 3 |

Marc Potters | Capital Fund Management | Co-CEO | 4 |

David E. Shaw | D.E. Shaw | Founder, CEO | 4 |

Anthony W. Ledford | Man AHL | Chief Scientist | 4 |

Stephen Della Pietra | Renaissance Technologies | Managing Director | 4 |

Lalit R. Bahl | Renaissance Technologies | Senior Researcher | 4 |

Alexey V. Kononenko | Renaissance Technologies | Managing Director | 4 |

Alexander Astashkevich | Renaissance Technologies | Senior Researcher | 4 |

Alkes L. Price | Renaissance Technologies | Managing Director | 4 |

Nicholas Patterson | Renaissance Technologies | Managing Director | 4 |

Peter Brown | Renaissance Technologies | Co-CEO | 4 |

John Overdeck | Two Sigma | Founder, Co-CEO | 4 |

David J. Hand | Winton Capital Management | Chief Scientist | 4 |

Neil A. Chriss | Hutchin Hill | Founder, CEO | 5 |

Robert B. Litterman | Kepos Capital | Chairman | 5 |

Alexander Belopolsky | Renaissance Technologies | Senior Researcher | 5 |

Robert J. Frey | Renaissance Technologies | Managing Director | 5 |

Of course one reason for this is, sophisticated mathematical models help beat the collective wisdom of the markets. But as explained earlier, E# measures more than mathematical prowess. It also accounts for collaborative skills. Mathematicians that are used to work as part of a research network exhibit behavioral traits that should be useful in the corporate world. Cracking the market’s fortune formulas is definitely a complex team effort that requires dozens of individuals working together, complementing each other. This combination of collaborative skills with mathematical proficiency, as measured by E#, is the stronger predictor of investment performance.

Collaborating effectively is not easy in mathematics, and should not be discounted as a common skill. It requires being able to share complex ideas in a respectful, objective and rigorous way. If understanding advanced math is hard enough, understanding cutting-edge in-the-making math is quite a feat. In addition, brilliant people often prefer to pursue their own ideas rather than embrace someone else’s in a collaborative effort. The ability to lead and persuade others to join an obscure intellectual struggle is rather uncommon.

As it is often the case in mathematics, the concept of E# was proposed without ever suspecting its future applications. The inventor of E# could not have envisioned that this notion would connect some of the richest people in the world, the princes of Finance, with good old Paul Erdős. As for the pauper of this story, he had the traits that make a great prince … if only he cared about earthly matters.

]]>Lopez de Prado argues that while economics is arguably one the most mathematical of the social sciences, the mathematical methods of economists may not be up to the task of modeling the complexity of the social institutions and the business/finance world. Outdated and inappropriate statistical methods are of particular concern, with economists and econometricians often drawing very dubious conclusions from the available data.

The

Continue reading Mathematics and economics: A reality check

]]>Lopez de Prado argues that while economics is arguably one the most mathematical of the social sciences, the mathematical methods of economists may not be up to the task of modeling the complexity of the social institutions and the business/finance world. Outdated and inappropriate statistical methods are of particular concern, with economists and econometricians often drawing very dubious conclusions from the available data.

The author suggests that graph theory, topology and even information theory and signal processing may be significantly more appropriate for these models. Machine learning methods may also be useful here.

Another issue is the inappropriate utilization of experimental methods, in particular the backtest. As we have demonstrated in several recent papers, backtest overfitting, selection bias and other errors are increasingly common in the field. In fact, in a time when one can write simple computer programs to explore millions or billions of variations of a proposed financial strategy, testing each based on historical backtests, and then only selecting the very best option, then that optimal variation is virtually certain to be statistically overfit. And if such a strategy is actually deployed, then the results could be disastrous.

Lopez de Prado then suggests that perhaps financial academics should commit a portion of their salaries to a validation of their proposed strategies and analysis — a documented track record…

Full details are in the published article.

]]>It is worth taking a brief look at the mathematics behind blockchain. The following is based in part on an article by Eric Rykwalder, one of the founders of Chain.com, a startup blockchain software firm in San Francisco.

The elliptic curve digital signature algorithmBlockchain is basically a publicly available ledger where participants enter data and

Continue reading The mathematics behind blockchain

]]>In a previous Math Investor blog, we described the emerging world of blockchain, emphasizing how it might impact the financial services and investment world. Already numerous firms, including several startup organizations, are pursuing blockchain to facilitate and streamline many types of financial transactions.

It is worth taking a brief look at the mathematics behind blockchain. The following is based in part on an article by Eric Rykwalder, one of the founders of Chain.com, a startup blockchain software firm in San Francisco.

Blockchain is basically a publicly available ledger where participants enter data and certify their acceptance of the transaction via an elliptic curve digital signature algorithm (ECDSA). An elliptic curve is an equation such as y^{2} = x^{3} + a x + b. In Bitcoin and most other implementations, a = 0 and b = 7, so this is simply y^{2} = x^{3} + 7 (see graph). Elliptic curves have numerous interesting properties, such as the fact that a nonvertical line intersecting two nontangent points will always intersect a third point on the curve. Indeed, one can define “addition” on the curve as finding that third point corresponding to two given points. This is basically what is done in ECDSA, except that the operations are performed modulo some large prime number M.

In particular, in ECDSA, addition of two points (p1,p2) and (q1,q2), and the doubling of (p1,p2), are performed as follows:

Addition of (p1,p2) and (q1,q2):

c = (q2 – p2) / (q1 – p1) mod M

r1 = c^{2} – p1 – q1 mod M

r2 = c (p1 – r1) – p2 mod M

Doubling of (p1,p2):

c = (3 p1^{2}) / (2 p2) mod M

r1 = c^{2} – 2p1

r2 = c (p1 – r1) – p2

Some readers will note that “division” is indicated in the first line of each algorithm. What this means is the product, modulo M, of the expression to the left of the slash by the multiplicative inverse of the expression to the right of the slash. Since M is a prime, every nonzero integer from 1 to M-1 has a multiplicative inverse. For example, the multiplicative inverse of 5 mod 17 is 7, because 5*7 = 35 = 1 mod 17; in other words, 5^{-1} mod 17 = 7. In practice, these inverses are rapidly calculated by means of the Euclidean algorithm, where one accumulates the divisors in a particular way. See a note by Nick Korevaar for some examples.

One other preliminary detail is how to “multiply” in this algebraic structure, in particular to calculate an expression such as m * (p1,p2) for some integer m. This can be done by first doubling the input (p1,p2), and then using the addition algorithm repeatedly until m copies of (p1,p2) have been added, but this of course is not practical when m and M are very large, as they are in real blockchain applications. Instead, such “multiply” operations are typically done using the binary algorithm for multiplication, which we will sketch here for ordinary integers but which can be easily adapted to ECDSA:

To compute r = n * b mod M: First set t to be the largest power of two such that t is less than or equal to n, and set r = 1. Then perform:

A: If n is greater than or equal to t, set r = b + r mod M, and set n = n – t; else set t = t / 2.

B: If t is greater than or equal to 1 set r = 2 * r mod M, and go to A (if t < 1, then we are done).

Computer scientists will immediately recognize this as almost identical to the binary algorithm for exponentiation modulo M, except that we are adding and doubling instead of multiplying and squaring. It is implied, for example, when one writes 3^{17} mod 10 = ((((3^{2} mod 10)^{2} mod 10)^{2} mod 10)^{2} mod 10) * 3 mod 10 = 3, thus performing the exponentiation in only five multiplications mod 10 instead of 16 or 17.

Now we may state the ECDSA algorithm (except that we omit some relatively minor details that apply mainly to real-world implementations):

First, select a modulus M, a “base point” (p1,p2), and a private key k1 (integer between 1 and M-1). These are typically selected such that the order of the base point (namely the maximum number of times (p1,p2) can be added to itself before the addition formula above fails due to zero divide) is prime and at least as large as M (this is not required but is normally done, and with this assumption the algorithm below is simpler). This often takes some experimentation, although practical applications can do this very rapidly.

As a concrete example, let us take M = 199 (which is prime), and the base point (p1,p2) = (2,24). For this M and (p1,p2), one can calculate that the order n = 211. Then let us select as our private key k1 = 151. We first need to calculate the public key (r1,r2) corresponding to the private key. This is done by multiplication:

(r1,r2) = k1 * (p1,p2)

where again the multiplication is done either by repeated summation or by the binary algorithm above. If we do this, we find that the public key (r1,r2) = (64,80).

Now select some data z1, say z1 = 104. We shall construct a digital signature of the data. This is done as follows:

1. Choose some integer k2 between 1 and n-1, where n is the order.

2. Calculate (s1,s2) = k2 * (p1,p2). If s1 = 0, return to step 1.

3. Calculate s2 = (z1 + s1 * k1) / k2 mod n. If s2 = 0, return to step 1.

Then the digital signature is (s1,s2). In our specific case, if we select k2 = 115, we calculate (s1,s2) = (99,52).

Now we can test the digital signature, as a third party might to verify that the transaction (which in this example we presume is coded in the data z1 = 104) is valid. This is done as follows:

1. Calculate u1 = s2^{-1} mod n

2. Calculate u2 = z1 * u1 mod n

3. Calculate u3 = s1 * u1 mod n

4. Calculate (t1,t2) = u2 * (p1,p2) + u3 * (r1,r2)

5. Verify that t1 = s1.

In our case, we find that the result of step 4 is (t1,t2) = (99,44). Since t1 = 99 = s1 (see above), the validity of the signature is confirmed (it is not necessary for t2 to equal s2).

We should emphasize that our example involves extremely modest-sized integers. In a real Bitcoin or blockchain application, these integers are typically 256 bits long, dramatically increasing the cost of performing the above operations, but, on the other hand, very dramatically increasing the cost required for someone to “break” the system, such as by computationally attempting to recover the private key from the public key.

So what conclusions can we draw from this exercise? First of all, it should be clear that the mathematics involved is not trivial, and the necessary computations to implement this scheme certainly are not trivial. Nonetheless what we have is an effective one-way function: it is relatively easy to verify a signature, but it is very difficult to work back from publicly available data, such as the public key, to obtain the critical private key.

ECDSA is the essence of how both Bitcoin and other blockchain applications work. The scheme has resisted some rather extensive testing for weaknesses, both mathematically and computationally. The few failures that have occurred in practice have generally been because users were not careful in protecting their private keys, or else they used a fairly standard pseudorandom number generator to produce the private keys, which attackers then exploited.

As with all the technology we rely on in our digital age, the weakest links are users who are not careful.

]]>A even more interesting development

Continue reading Is blockchain technology about to upend the financial world?

]]>Many people have heard of Bitcoin, a shadowy form of currency that operates outside normal banking channels. It was introduced in October 2008 by a computer scientist under the alias Satoshi Nakamoto, and later released in the form of open-source software in 2009. Over 100,000 merchants now accept Bitcoin for products and services; the total value of circulating Bitcoins is currently about 10 billion U.S. dollars. In May 2016, Craig Steven Wright, an Australian computer scientist, publicly confessed to being Satoshi Nakamoto, although some skeptics still dispute his claim.

A even more interesting development is that blockchain, which the underlying mathematical technology of Bitcoin, is being actively explored for a variety of applications in the financial and business world to take the place of trusted intermediaries such as banks, brokerages, funds and exchanges.

Nowadays, investors who trade loans or derivatives or transfer funds internationally are saddled with tediously complicated and time-consuming back-office processes, which rely on negotiated contracts between buyers and sellers, all mediated by contract specialists and lawyers. Some types of syndicated loan exchanges can take up to 20 days to conclude.

Thus some in the industry, such as former J.P. Morgan investment banker Blythe Masters, are convinced that blockchain technology can be used to streamline many types of financial transactions. A June 2015 report by Santander InnoVenture estimated blockchain-related technologies could save financial institutions USD$20 billion per year in settlement and international fund transfer costs.

The idea of a blockchain is that a series of encrypted transactions are connected in a chain, where each transaction contains a hash of the prior block in the chain, so that it is irrevocably connected to the previous transaction. Security comes from the fact that the blockchain database is replicated in many different sites — there is no “official” copy, and no particular site or user is trusted any more than any other site or user. Two (or more) parties can perform a transaction by posting it to the blockchain. Since the posted block includes a publicly verifiable digital signature of both all parties, any third party can verify that each of the transactees participated in the transaction.

The mathematics behind blockchain is described, with examples, in a separate Math Investor blog.

Among those organizations already offering blockchain services are:

- Real Asset in London offers a service for gold owners to record their metal on the blockchain; soon they will be able to trade.
- MeXBT in Mexico City proves a Web-based app that permits migrants to send money via blockchain to Mexico and withdraw cash from ATM machines.
- Everledger, a London startup, provides a “fingerprint” service for large diamonds, recording a stone’s characteristics on the blockchain all the way from the mine to the final purchaser.
- Factom in Austin, Texas is constructing a land title registry in Honduras so that homeowners can defend their property from unlawful seizures.
- Earthport, a London startup, and Ripple Labs, a San Francisco startup, have launched an international payments network based on a private blockchain.

Other organizations, both new and existing, are hard at work developing various capabilities. These include:

- Digital Asset Holdings, a firm created by Blythe Masters, is developing a distributed ledger to handle the settlement of pooled corporate debt. It is also developing a system to record and settle short-term government bond trades.
- Nasdaq is developing a system based on blockchain for trading shares in closely held concerns.
- Chain, a San Francisco startup, is offering software tools for developers to build apps to transmit almost anything on a blockchain ledger, even including airline miles and other loyalty points.

The financial industry is already reeling from the introduction of new technologies, and those organizations that have been slow to adopt these technologies have, in many cases, been left behind. One example, now about 20 years in the past, is Internet-based security trading for consumers. Another example is low-cost index funds, typically operated by computer programs with almost no overhead so that they can operate with fees as low as 0.05% per year. These funds are now available not only from Vanguard and Blackrock, but also, although in some cases belatedly, from major brokerages. Actively managed funds are, in many cases, reeling from the competition, even though many analysts agree that some actively managed investments, based on fundamentals, are essential for the proper functioning of markets.

Another example of the financial industry being slow to adjust is the hedge fund industry, which is at a loss as to how to manage in their miserable new world, not only competing with low-cost index funds, but also with other hedge funds and similar organizations who have embraced modern quantitative finance methods. Some firms who delayed their move into the quantitative finance arena are now struggling to catch up.

Is history repeating itself with blockchain technology?

A May 2016 Harvard Business Review article described numerous potential applications, both in finance but also in other sectors of the economy. The music industry, for example, could be transformed by “smart contracts,” which permit artists to sell directly to consumers without going through a label. Blockchain-based payment systems may run without banks, credit card companies or other intermediaries. Similarly, blockchain-based schemes could transform the manufacturing world, as intellectual property for almost any product could be more securely protected and appropriate fees exchanged.

In short, it really does appear that blockchain technology is poised to make major inroads into the financial industry. Time will tell who will be the most successful in this brave new world.

[Added 23 Oct 2016: A Bloomberg News article describes an “experiment” by the Commonwealth Bank of Australia, Wells Fargo Bank and Brighann Cotton to process a large shipment of cotton, including payment and transfer of ownership, all through a blockchain-based contract.]

]]>So how hard is it to design a stock fund that will achieve a given performance profile? The present bloggers

Continue reading How difficult is it to design a stock fund based on backtests?

]]>Over USD$2 trillion is held in exchange-traded equity funds, just in the U.S., with hundreds of new funds added each year. Strategies vary from simple index-tracking funds to funds that follow sophisticated strategies (e.g., “smart beta”) designed to yield impressive results, based on backtests. According to a Vanguard report, there is concern that many of these funds are not really independent of the indexes they follow, and in any event are not that different from the broad market.

So how hard is it to design a stock fund that will achieve a given performance profile? The present bloggers explored this question in a new technical paper.

What we did was to demonstrate that given virtually ANY desired performance profile, one can devise a stock fund portfolio, constructed from S&P500 stocks, that achieves that profile, based on backtests. Do you want a steady 8% per annum growth, month after month, year after year? You can have it — or 10% or 12% or 15% (all based on backtests, over say a 15-year period). We even constructed portfolios that exhibit a stair-step or sinusoidal growth, just to demonstrate that any profile can be used.

The basic approach employed by our computer program that constructs these portfolios is as follows. Given a set of stocks and a desired performance profile, we employ techniques of optimization theory to find a set of weights that minimize the sum of squares deviation of the weighted portfolio time series from the target profile time series. The resulting mathematical formulation is in the form of a matrix equation, which can be solved using widely available linear algebra software. Mathematical details are given in the technical paper.

When this technique is implemented on real stock data, often at least some of the resulting weights are negative, meaning that those stocks are shorted in the resulting portfolio. While shorting is certainly a legitimate trading strategy, shorting exposes the portfolio to potentially large losses, so we also constructed portfolios subject to the contraint that each weight must be greater than zero.

What we found was as follows. First of all, we definitely succeeded in achieving the target profile on in-sample (backtest) data — our standard portfolios (with positive and negative weights) matched the desired profile perfectly in-sample in every case.

So now for the $64,000 ($64 million?) question: How do these computer-constructed stock portfolios perform on new (out-of-sample) data?

Answer: decidedly mixed. In some cases, the fitted standard portfolios exceeded the target profile performance. But in most other cases, the portfolios had a very different fate, namely complete ruin — a catastrophic drop to zero, after which the portfolio is presumed to be liquidated. The portfolios designed under the constraint that all weights are positive avoided these catastrophic drops, but in those cases the performance is typically quite unlike the target portfolio, both in-sample and out-of-sample.

In ten test cases that we tried, seven of the standard-weight portfolios resulted in catastrophic losses (see, for example, the graphs below); only three achieved positive Sharpe ratios out-of-sample. Among the corresponding all-positive-weight portfolios, there were no catastrophic drops to zero, but the out-of-sample Sharpe ratios were all less than zero, and and the time series were poorly correlated with the target profiles.

Some examples of the standard-weight portfolio results are shown below. The orange curves are target profiles; blue is achieved performance; green is S&P500 for reference. The in-sample period is 1991 through 2005; the out-of-sample period is 2006 through 2015 (note that in each case, the blue curves coincide with the orange curves during the in-sample period). A full set of graphs and results is in our technical paper.

We have shown that it is relatively straightforward to produce a stock portfolio that achieves any desired performance profile, based on backtest (in-sample) data. However, the resulting portfolios tend to perform erratically on new (out-of-sample) data, certainly not following the target profile, and, in fact, resulting in complete ruin in many cases. Significantly less erratic results can be obtained by imposing constraints that restrict the portfolio to positive weights, but the resulting portfolios typically depart significantly from the target profile on both the in-sample and out-of-sample data.

The erratic performance observed in our results on out-of-sample data is a classic symptom of backtest overfitting. In fact, overfitting is unavoidable in this or any scheme that amounts to searching over a large set of strategies or fund weightings, and only implementing or reporting the final optimal scheme.

The same difficulty afflicts many other attempts to construct an investment strategy based solely on daily, weekly, monthly or yearly historical market data, such as by trying to discern patterns in stock market indexes by examination of charts (as is often done by technical analysts) or designing a portfolio that tracks a particular risk profile, as many smart beta ETFs attempt. Any underlying actionable information that might exist in such data has long been mined by highly sophisticated computerized algorithms operated by large quantitative funds and other organizations, using much more detailed data (minute-by-minute or even millisecond-by-millisecond records of many thousands of securities), who can afford the expertise and facilities to make such analyses profitable. Any lesser efforts, such as those described in our paper, are doomed to be statistically overfit, and if followed may well have disastrous consequences.

Full technical details are available here and in a forthcoming journal article.

]]>Continue reading The folly of panic selling

]]>- August 2015: Concerns about the Chinese economy and stock market led to panic selling, with the Shanghai index plunging 8.5% in one day. Soon after in the U.S., on August 24, 2015, the DJIA plunged over 1,000 points in just a few minutes, its most precipitous drop ever, ending the day down 588 points, its worst one-day loss in five years.
- January 2016: Concerns about the direction of the U.S. economy, and fears that the U.S. stock market was overheated led to a 5.5% drop during January, with the Nasdaq composite down 8%, its worst month in six years.
- February 2016: U.S. stocks took another dive, as investors freaked out over (rather than celebrated!) oil’s drop below USD$27 per barrel. As of February 11, the DJIA had lost 1765 points since the start of the year. The Nasdaq was close to bear market (20% decline) territory.
- June 2016: Worldwide markets panicking over the U.K.’s Brexit vote wiped out USD$3 trillion.

Along the way, there have been numerous solemn prophecies of doom, some of them very dire (and certain) in their predictions:

- Can Anything Prevent a U.S. Stock Market Crash in 2016?.
- 80% Stock Market Crash To Strike in 2016, Economist Warns.
- Analyst: Here Comes the Biggest Stock Market Crash in a Generation.
- The man who accurately predicted 4 market crashes told us 3 more dates to worry about this year.
- RBS cries ‘sell everything’ as deflationary crisis nears.

Now it must be kept in mind that it is entirely possible that some or all of these predictions might materialize. Indeed, a major market correction might already be underway when one reads this piece. But volatility is the nature of markets in general and stock markets in particular — investors who do not have the stomach for roller-coaster rides should place their savings and investment elsewhere.

But one does have to ask what is the point of panicking during a market decline. If one sells, it is statistically more than likely that one will ultimately take a loss, compared with a buy-and-hold approach (because it is statistically more likely that one is selling out near the market bottom). And the deeper the market decline, the more statistically certain it is that selling will ultimately result in a major loss.

For example, millions of panicking investors sold billions of dollars (and euros, pounds, yen and yuan) of stocks on 9 March 2009, which was the bottom of the 2007-2009 bear market. Many of them later bought back into the market, but in most if not all cases their investments took a major permanent hit in the process, because they bought back at a significantly higher price. One financial colleague of ours reports that at least one client of his never bought back into the market.

A recent DALBAR study found that over a 30-year period, the average self-directed equity mutual fund investor earned only 3.7 percent, compared with 10.3 percent that could be obtained by simply investing in a S&P500 index fund. Much of this huge shortfall is due to panic selling during market downturns, or attempts to “time the market.” Indeed, the American system of relying on 401K accounts for retirement savings has been a decidedly mixed experiment, with typical returns very much less than a simple buy-and-hold, low-cost index fund strategy.

At least individual investors have plenty of company as they lament their inability to predict or time the vagaries of the stock market. Hedge funds, those boutique financial operations that cater to very wealthy investors (and charge similarly exalted fees) have not done very well either. The HFRI index of U.S. hedge funds posted an average loss of 0.85% during 2015, compared with a 1.36% gain in the S&P500 index. And over the past five years, the Barclay hedge fund index has posted an average 3.36% gain, substantially less than the average 12.58% gain for the S&P500 index.

Along this line, in 2008 Warren Buffett entered a bet with a hedge fund manager that a portfolio of hedge funds would not out-perform the S&P500 index over the next ten years. Eight years into the bet, it appears that Buffett will win hands down, as the hedge fund portfolio is up only 20%, whereas the S&P500 index is up 63%.

Paul Merriman, citing the DALBAR report, assesses the situation in these terms:

]]>The numbers change from year to year, but every DALBAR report comes to the same conclusion: Investors’ emotion-based trading is counterproductive.

Along with many others, I have tried over the years to educate investors about the effects of what DALBAR describes as “knee-jerk reactions to crises and mistakes.”

Has that helped? Here’s what DALBAR says: Despite “enormous efforts by thousands of industry experts to educate millions of investors, imprudent action continues to be widespread. … The belief that investors will make prudent decisions after education and disclosure has been totally discredited.”