Niklas Lappe
Beating the Market: A Quantitative Approach to Fundamental Investing
Master Thesis
Chair of Entrepreneurial Risks Swiss Federal Institute of Technology (ETH) Zurich
Supervision Sumit Kumar Ram Prof. Dr. Didier Sornette
May 2020
Contents
Abstract iii
Nomenclature iv
1 Introduction 1
2Data 3 2.1 Price Data ...... 3 2.2 Fundamental Data ...... 4
3 Methodology 5 3.1 PortfolioandBenchmarkConstruction ...... 6 3.1.1 BenchmarkConstruction ...... 6 3.1.2 PortfolioConstruction ...... 7 3.2 Prediction Metrics ...... 8 3.3 Ensemble Properties of the Financial Ratios ...... 11 3.3.1 Distributions ...... 11 3.3.2 Joint Distributions ...... 15 3.3.3 Canonical Averaging of the Volatility and Return Time Series conditional on Financial Ratios ...... 18 3.4 CopulaAnalysis ...... 21 3.4.1 Introduction ...... 21 3.4.2 Calibration ...... 24 3.5 Random Forest Model ...... 29 3.5.1 Mathematical Formulation ...... 29 3.5.2 Random Forest Regressor ...... 30 3.5.3 Training and Testing Sets ...... 32
4 Results 33 4.1 ClassificationExperiment ...... 33 4.1.1 Profit and Loss Prediction ...... 33 4.1.2 Outperformance and Underperformance Prediction ...... 34 4.2 Basic Experiment ...... 35 4.2.1 Fixed Training Set ...... 35 4.2.2 Dynamic Training Set ...... 38 4.3 Sensitivity Analysis ...... 41 4.3.1 Fixed Training Experiment ...... 41 4.3.2 Table Form of Fixed Training Experiment ...... 44 4.3.3 ComparisonofTrainingSets ...... 46 4.3.4 Dynamic Training Experiment ...... 50 4.3.5 IndustryPerformance ...... 53 4.4 Relative Features Experiment ...... 54
i 4.4.1 Fixed Training Set ...... 55 4.4.2 Dynamic Training Set ...... 58 4.5 Sector Features Experiment ...... 61
5 Conclusion 66
Bibliography 69
AData 72 A.1 Introduction...... 72 A.2 Data ...... 73
BDistributions 80 B.1 Joint distributions ...... 114 B.2 Canonical averaging of the volatility and return time series conditional on financial ratios ...... 116 B.3 Copulas ...... 120
C Experiments 128 C.1 AdditionalPlotsfor4.2...... 128 C.2 AdditionalPlotsfor4.2.4 ...... 131 C.3 ClassifiersforRelativeFeatures ...... 134 Abstract
Financial markets have long been a playing field for both private and professional investors that aimed to generate profits from trading. Common theories imply that the search for superior return is hopeless and most investors are not able to generate returns far above the average market return. This thesis attempts to contradict this hypothesis by developing a machine learning based portfolio management algorithm with the goal of outperforming the S&P 500 index. We use a large data set that contains fundamental data for each stock in the S&P 500 for the last 30 years. We conduct an exploratory analysis of this data to generate first insights on the influences of fundamentals on stock performance. Thereafter, we apply a copula analysis to identify the strongest dependencies between fundamentals and stock returns. Eventually, we use a random forest predictor to forecast quarterly stock performances by estimating different performance indicators using the underlying fundamental data. The forecasts of the random forest predictor are then used to build a set of portfolios for different performance indicators and fundamentals. The analysis shows that some of those portfolios are indeed able to outperform the S&P 500 index. The best random forest predictor can be accepted for a significance level of 0.1% against a random predictor.
Keywords: portfolio management, fundamental investing, copulas, machine learning, random forests, efficient market hypothesis, S&P 500
iii Nomenclature
Symbols
SStock MMarket PStockprice RReturn QQuarter
↵ Return difference between a security and its benchmark Covariance(RS ,RM ) Variance(RM ) LR Log Return Difference metric IR Information ratio SR Sharpe ratio
Acronyms and Abbreviations
S&P 500 Standard & Poor’s 500 Stock Index ICB Industry Classification Benchmark RF Random Forest
Corr Pearson’s correlation coefficient Tau Kendalls’s tau Rho Spearman’s rau CDF Cumulative Distribution Function PDF Probability Density Function
CAPM Capital-Asset-Pricing-Model APT Arbitrage Pricing Theory EMH Efficient Market Hypothesis
iv Chapter 1
Introduction
Ever since the first share was traded on the Amsterdam stock exchange in the beginning of the 17th century, 1 both professional and private investors have been trying to generate profits from stock trading. This thesis attempts to add to the universe of investment strategies by developing a machine-learning model which is able to pick undervalued stocks and use those stocks to create outperforming portfolios. For traditional long-only trades to be profitable, an investor needs to buy an undervalued stock at alowpriceandresellitforahigherprice.Sincepresentassetpricescanbeobtainedeasily,the difficult part is estimating the price of an asset in the future. A variety of asset pricing models have been developed to solve this challenge. The most common model is the Capital-Asset-Pricing Model (Sharpe, 1964; Lintner, 1975), which states that the return of a single security solely depends on the risk-free rate, the general market return and the security’s volatility in respect to the systemic risk of the market ( ). It seems intuitive that an increase in beta, which can be understood as an increase in risk, should be rewarded with higher returns since there is no incentive for a rational investor to accept more risk for less reward. However, the CAPM model has been empirically proven to be insufficient for accurate asset pricing. For example, Fama and French (2004) show that there are many examples in which stocks with lower provided superior returns than their high- peers. Therefore, additions have been made to the model by critics. Black (1972) introduced the zero-beta CAPM model, which states that azero-betaportfolio’sreturncandeviatefromtherisk-freerate.Forthispurpose,hereplaced the risk-free rate with a stock-specific rate that describes the expected return of the stock for =0. Although it has been shown that this model provides better results than the CAPM model, in practice, estimating a stock-specific rate for each security is difficult. In the decades following Sharpe and Black, several economists (Rubinstein, 1973; Merton, 1973; Breeden, 2005) have adapted the model further and introduced additional components. However, the underlying problem remains: Only historical stock returns can be used as proxies for future returns in these models. Roll and Ross (1980) contradicted the CAPM model and concluded that alone is not sufficient to describe the overall price trajectory of an asset. They proposed a new model, the Arbitrage Pricing Theory, that includes more macroeconomic variables. The four variables suggested by Roll and Ross are inflation, industrial production, risk premiums and the yield curve. Each of those variables has a stock-specific sensitivity which is used to calculate the expected return of the stock. Although daily fluctuations and short-term behaviour of stocks can follow different variables, Ross claims that the long-term performance of a stock is mostly predictable by those four variables.
1The first historically documented public company was the East India Company in 1602
1 2
Research has shown that in fact both the CAPM model and the APT model have a certain predictability of future stock returns, with the APT model outperforming the CAPM model (Chen, 1983; Groenewold Fraser, 1997). These results contradict the prevalent Efficient Market Hypothesis proposed by Fama (1970), which states that (stock-) markets reflect all available information and hence can be neither predicted nor outperformed in the long run because it is impossible to forecast new information. Thus, stock prices are often said to follow a random walk, the same way as incoming information does (Malkiel, 1999). This theory is also the foundation for the pricing of other securities, specifically derivatives that are based on underlying stocks (Black and Scholes, 1973). This thesis is based on the assumption that the EMH is incorrect otherwise there would not be any reason for pursuing further analysis and predictions in the following. The previously mentioned asset pricing models describe the relationship between a small set of specific input variables and the expected return of an asset as linear. In contrast, we will use a random forest predictor on a large set of fundamentals to predict future stock returns without applying an underlying theory like the CAPM or APT. This methodology is motivated by the fact that most “traditional” portfolio managers follow a similar approach and study fundamental data to pick stocks. The fundamental analysis dates back to Graham and Dodd (1934) and is the core of “value investing”. It is one of the most common methods and is often, especially in the long run, preferred to technical analysis. Shiller (2015) studied the influence of one of the most frequently used fundamentals, the Price-to- Earnings ratio (P/E), on future returns and found that P/E ratios are a strong indicator of good long-term stock performance (Appendix A1). Using a quantitative approach to fundamental investing is not a new idea and has been imple- mented by Lewellen (2004) using dividends, P/E and book-to-market ratios, and by Pontiffand Schall (1998) using only book-to-market ratios, to only name two. Both papers claim that the predictability of these fundamentals is significant. The goal of this thesis is to answer the question: Are we able to outperform the S&P 500 index using a machine learning model that predicts future stock returns? For this purpose, we increase the number of fundamentals extensively compared to Lewellen, and Pontiffand Schal to improve the predictability of future stock returns and eventually apply this to a real-life scenario by building a portfolio and comparing its performance to that of the index over the long term. After a short introduction to the data, we conduct an exploratory analysis of the data and analyse relevant trends and relationships. In the last part, we introduce the random- forest model used for the return predictions and backtest a variety of different portfolios that are based on the random-forest predictor. Chapter 2
Data
The stocks used for this project are the members of Standard & Poor’s 500 index (S&P 500) as of November 2019. The stocks are categorized by their sectors using the Industry Classification Benchmark by Dow Jones and FTSE on a sector level (Russel, 2019). The system classifies stocks into 41 sectors of which 37 sectors are included in the S&P 500 index. A detailed list can be found in Appendix A2. For each of the stocks the data set includes price and fundamental data, which were both obtained from Thomson Reuters’ Eikon Reuters.
2.1 Price Data
The price data obtained from Yahoo Finance contains daily closing prices of each stock for a 30 year period (03/10/1989 - 03/10/2019) for each day the respective stock was traded during this period. We find two issues with the data set. First, not every stock in the index has been public for the last 30 years and therefore does not provide historical price data. Second, some stocks that have been part of the index in November 2019 have not been part of the index for the last 30 years continuously, which means that the stock set is not replicating the behaviour of the actual S&P 500 index, but of the S&P 500 index of November 2019 projected back for 30 years. To demonstrate this, we constructed an equal-weighted portfolio out of the stock set and compared its performance to that of the actual S&P 500 index. One can see that the stock set contains a survivor and new entrance bias and the portfolio based on the stock set has a better performance than the actual S&P 500 index over that period, as can be seen in Figure 2.1:
3 42.2.FundamentalData
Figure 2.1: Performance of the actual S&P 500 index over the last 30 years, compared to the performance of our stock set which includes survivorship bias. The y-axis displays the normalized prices for both portfolios, starting at 100 in a logarithmic scale.
The annualised return of the S&P 500 index over that period was 7.3%, while the equal-weighted stock set would have generated an annualised return of 13.5%. To control for that effect, the benchmarks used for the random forest portfolios are based on the stock set rather than the actual S&P 500. Besides that, the stock set is reduced to the stocks that have been part of the S&P 500 index continuously during the last 30 years to avoid missing data. After applying that rule and cleaning the data set further, the final stock set comprises 222 stocks and 34 sectors. A list of all remaining stocks can be found in the Appendix A2. The price data will be used to calculate stock returns which are used to define prediction metrics later on.
2.2 Fundamental Data
The fundamental data contains the balance sheet, the cash flow statement, the income statement, ratio metrics and profit ratios for each stock. The specific fundamentals vary per stock, but in total the data set contains 411 different unique fundamentals. There is no fundamental that is consistently reported for each company. A list of all fundamentals can be found in Appendix A2. The fundamentals are reported quarterly or half-yearly depending on the company. The first quarter of the fundamental data is the 28/10/1989 and the last reported quarter is the 01/09/2019. Therefore, the fundamental data set is smaller than the price data set and the models can only be computed for the intersection of both sets. The fundamental data are used as features for the following prediction models. Chapter 3
Methodology
This chapter introduces the methods applied to the data set to forecast future stock performances and use those results to generate portfolios. This First, we introduce as benchmark and a general process of constructing portfolios. Second, we study performance indicators that we use as prediction targets for the prediction model. This is followed by several analysis of the fundamental data that we use as input features to train the prediction model. Last, we define our problem mathematically and specify the random forest model.
5 6 3.1. Portfolio and Benchmark Construction
3.1 Portfolio and Benchmark Construction
The goal of the thesis is to build portfolios that can outperform the S&P 500 index, or in our case rather the stock set which is based on the S&P 500 as of November 2019. Therefore, we need to find a subset of the stock set that performs better than the complete stock set overall. It is important to construct the portfolio and the benchmark index in a way that does not benefit nor disadvantages the portfolios against the benchmark. Thus, we use a simple equal-weight approach for both the portfolio and the index. In the first step, the stock set is split up in its subsectors according to the Industry Classification Benchmark and each stock is grouped with its peers according to its sector (Russel, 2019).
3.1.1 Benchmark Construction For the index, that we use as a benchmark to evaluate the performance of the portfolios, we use a buy and hold strategy. That means that we buy each stock with its specific weight in the beginning of the 30 year period and hold it throughout the entire period. Therefore, we do not have any reinvestments for the index. Figure 3.1 displays how the weights for each stock are calculated. First, for each sector all stocks in that sector are equal-weighted to calculate a sector index. Second, the sector indexes are again equal-weighted themselves to find the weights for the complete index. Therefore, the weight W (S) of a stock S is calculated as follows:
1 W (S)= (3.1) nz where n is the number of sectors, which is constant with n = 34,andz is the number of stocks in the sector of stock S. z is called k and j in Figure 3.1
Figure 3.1: Index construction
The advantage of building the index in this way is, that neither a sector nor a stock is preferred based on its market-capitalization as in a market-capitalization weighting. This should prevent small-cap and sector biases. Chapter 3. Methodology 7
3.1.2 Portfolio Construction The portfolio is constructed as similar as possible to the index to avoid any biases. Instead of equal-weighting all stocks on a sector level, we only buy one stock per sector based on the forecasts of our model. To outperform the index, these stocks are the ones the model identifies as the best stock in each sector. This means we have 34 stocks per portfolio. It would be possible to hold more stocks of each sector, but by only holding one stock per sector at a time, we can reduce diversification and thus highlight the functionality of the underlying prediction model. These 34 stocks are equal-weighted in the beginning on a portfolio level similar to the index.
Figure 3.2: Portfolio construction
Since our predictions change over time, the stocks in each sector index can also change accordingly. If this happens, the stock that was hold for that sector at the time, is sold and a new stock enters the sector portfolio. Therefore, we have to incorporate reinvestments. The buy and hold strategy of the index does not allow any flows from one sector to another sector, thus we will reinvest similarly for the portfolio. Therefore, all profits that occur after a sale of a stock will be completely reinvested in a new stock from the same sector. This implies that over time the weights of the sectors might change in the portfolio and the index. The portfolio is re-balanced every time our prediction model indicates a change in future stock performances which usually happens whenever acompanyreportsnewfundamentaldata. All models exclude trading costs and other non-ideal conditions for both the portfolio and the benchmark index. This is a fair assumption as long as we keep the conditions equal for the portfolio and the index. The model should be considered a theoretical construct to test the prediction boundaries of modern stock markets rather than an actual trading strategy at this point, however it could be easily implemented as such. 83.2.PredictionMetrics
3.2 Prediction Metrics
Several performance indicators can be considered to estimate the attractiveness of a stock com- pared to its peers. The following chapter introduces three performance indicators that we use as prediction metrics for the experiments.
Log Return Difference With the goal to outperform a benchmark, the obvious choice is a metric that measures the outperformance of a stock against its sector index directly. Therefore, we define the first metric as the quarterly average of the daily logarithmic return differences of a stock versus its sector index for a given quarter: 1 T P S P I LR(QS)= log t+1 log t+1 , (3.2) n T P S P I t=1 t t X S I where S is a stock and I the stock’s sector index. Pt is the price of stock S at day t,andPt is the price of index I at day t respectively. We define QS as the nth-quarter of stock S, where QS t. n n 2
Information ratio A ratio often used to measure the performance of portfolio managers is the Information ratio, which sets a portfolio’s outperformance in relation to the tracking error between portfolio and benchmark (Kidd, 2011): R S R I S Qn Qn IR(Qn)= , (3.3) S Qn S I where S is a stock and I the stock’s sector index. Pt is the price of stock S at day t,andPt is the S S price of index I at day t respectively. We define Qn as the nth-quarter of stock S, where Qn t. S/I 2 r S I t R S Additionally, we define t as the daily return of or for day ,and Qn as the cumulative S R S Q return of the stock and Qn as the cumulative return of the index over the quarter n.Similarly, S Qn is the tracking error, defined as the quarterly variance of daily return differences between the portfolio and the index.
Sharpe ratio One of the most common performance indicators for fund performance is the Sharpe ratio, which was introduced by William F. Sharpe in 1966. The Sharpe ratio, which is a risk-adjusted performance indicator of a security or portfolio, can be used independently from a stock benchmark. The Sharpe ratio measures the outperformance of a security compared to the risk-free rate divided by the security’s volatility:
R S R S Qn F SR(Qn)= , (3.4) S Qn
S I where S is a stock and I the stock’s sector index. Pt is the price of stock S at day t,andPt S is the price of index I at day t respectively. We define Qn as the nth-quarter of stock S, where S S Q t r S t R S n .Additionally,wedefine t as the daily return of on day ,and Qn as the cumulative 2 S Q R S return over a quarter n,and F as the quarterly risk-free rate. Similarly, Qn is the volatility, defined as the quarterly variance of daily returns. Chapter 3. Methodology 9
Verification of performance indicators Before we can use these performance indicators in the prediction model, it should be verified that all of them actually indicate outperformance of stocks if predicted correctly. Therefore, we construct three portfolios using the different performance indicators and an index according to the process of Chapter 3.2. For each of the three portfolios (Log Return Difference, Information ratio, Sharpe ratio) we choose the best stock per sector as the stock with the highest respective performance indicator at each day. Figure 3.3 and Table 3.1 provide the results of this analysis:
Figure 3.3: Performances of the portfolios based on the Log Return Difference, the Information and Sharpe ratio as defined above, assuming knowledge of the metrics in the future, compared to the index constructed for our stock set.
Portfolios Performance Indicator Log Return Difference Information ratio Sharpe ratio Index Alpha p.a. 326% 247% 205% Sharpe ratio 3.37 3.63 3.43 0.73 Information ratio 3.55 4.07 3.73
Table 3.1: Performance indicators for the three different portfolios and the index. The portfolios clearly outperform the benchmark index, suggesting that the performance indicators are good prediction metrics.
As we can see in Figure 3.3 and Table 3.1, all three portfolios outperform the benchmark index significantly, proving that the performance indicators are good prediction metrics if predicted correctly. The Log Return Difference portfolio is clearly outperforming the benchmark with an annualised alpha versus benchmark of 326%. The Sharpe and Information ratios are also significantly higher than for the sector index. Looking at the extraordinary returns, it is obvious that this strategy could not actually be traded for liquidity reasons, even if one could perfectly predict the metrics, as assumed in this example. 10 3.2. Prediction Metrics
The Information ratio tries to assess how much of a portfolio’s outperformance is actually generated by the expertise of a portfolio manager rather than an increased risk taking, which is controlled for by the tracking error. Therefore, we would expect high risk-adjusted returns for the Information ratio portfolio. As we can see in Figure 3.3, if we build a portfolio choosing the stock with the highest Information ratio from each sector for each quarter, this portfolio is also resulting in a high alpha versus its benchmark with especially high Sharpe and Information ratios. Since the Sharpe ratio measures risk-adjusted returns against the risk-free rate, in theory, it is not obvious that this directly leads to an absolute outperformance against the stock benchmark. Instead, the ratio could deliver a low volatility portfolio with low returns, which could also result in a good Sharpe ratio. The figure suggests that in practice both the risk-adjusted and the absolute returns are preferable to the benchmark. The previous portfolios have shown that all prediction metrics are good indicators to identify outperforming stocks. The Log Return Difference metric seems to be the best indicator for alpha- generating stocks that also have good but lower risk-adjusted returns than the other metrics. This could have been expected because the Log Return Difference metric is the strongest indicator of outperformance. The Information ratio prediction metric provides the highest Information ratio of a portfolio, with an alpha smaller than the Log Return Difference but higher than the Sharpe ratio. This can be explained by the fact, that opposite to Sharpe ratio, the Information ratio incorporates the outperformance of a stock. The Sharpe ratio is the only metric which does not measure any outperformance versus the stock index, but rather measures absolute risk-adjusted returns. Therefore, it seems legitimate that the Sharpe ratio portfolio has the lowest alpha of the three metrics. Although one would expect it to have the highest Sharpe ratio, this cannot be verified by the simulation. On the contrary, the Sharpe ratio is lower than for the Information ratio portfolio. A possible reason for this discrepancy between expectation and result could be that the model uses the highest Sharpe ratio for each quarter to build the portfolio instead of optimizing the Sharpe ratio for the 30 year period Overall, all three performance metrics are good indicators for the outperformance of a stock against its benchmark and from here on will be used for the experiments of Chapter 4. Chapter 3. Methodology 11
3.3 Ensemble Properties of the Financial Ratios
After defining indicators for portfolio performances, it is also worth analyzing the performance drivers, namely the firms’ fundamental data, in detail. The following chapters contain noteworthy examples of those fundamentals to illustrate the format of the data and its relation to the firms’ performances. Unfortunately, we can neither display the plots for all fundamentals in the main part nor in the appendix of this thesis, since the fundamentals are amassing to thousands. Therefore, the following illustrations should rather be understood as filtered and selected samples.
3.3.1 Distributions The first analysis is showing the distributions of fundamentals on a sector level (see Appendix B for all distributions). To generate the distributions, we find intersecting fundamentals for a sector, meaning all funda- mentals that each of the stocks reports in a given sector. For each of the intersecting fundamentals we collect all reported fundamental values of all stocks within a sector over the 30 year period and plot their distributions in the following histograms.
Earnings per Share
(a) Aerospace and Defense (b) Automobiles and Parts
(c) Banks (d) Construction and Materials
Figure 3.4: Distributions of Earnings per Share for selected sectors. 12 3.3. Ensemble Properties of the Financial Ratios
The first set of histograms displays the distribution of the “basic-normalized-eps” which is a nor- malized measure of the earnings per share for four different sectors. Since the earnings per share have been normalized, they can be easily compared among different stocks and even sectors.
This specific fundamental shows similarities between different sectors. Especially the “Aerospace and Defense” and the “Automobiles and Parts” distributions, which are both manufacturing in- dustries, have a comparable range of earnings and both peak around the same value. The “Banks” sector has the longest tails of all four distributions, ranging from -6 to 6, whereas the “Construction and Materials” sector seems more defensive and has little negative earnings to report.
Current ratio
(a) Aerospace and Defense (b) Automobiles and Parts
(c) Banks (d) Construction and Materials
Figure 3.5: Distributions of Current ratios for selected sectors.
The Current ratio is used to assess the liquidity and short-term credit worthiness of a firm. It is calculated by dividing current assets through current liabilities, which must result in a value larger than or equal to zero. A high ratio implies a high liquidity of a company.
Although the distributions follow a similar pattern, one can see that the Current ratios vary significantly for different sectors. Especially the “Automobiles and Parts” sector has on average good Current ratios, whereas the “Fixed Line Telecommunications” sector is generally associated with less liquidity. In fact most Current ratios of the “Fixed Line Telecommunications” sector are below 1, which indicates that firms have difficulties meeting their short-term obligations. Chapter 3. Methodology 13
Dividends
(a) Aerospace and Defense (b) Automobiles and Parts
(c) Banks (d) Construction and Materials
Figure 3.6: Distributions of Dividends for selected sectors.
The plots above show the distributions of dividends that were paid to shareholders. Since dividends are negative cash-flows for the distributing firm, the fundamental values are negative by definition. We can see that in general most dividend payouts are small or zero. Nevertheless, the tails of the distributions are long. As we can see, the magnitude of the dividends is relatively consistent for the first three sectors. In general, dividends can vary with the size of the firms in a sector, as can be seen for the “Construction and Materials” sector. Therefore, the dividend fundamental differentiates itself from the earnings per share or the Current ratio because it is not normalized. 14 3.3. Ensemble Properties of the Financial Ratios
P/E ratio
(a) Aerospace and Defense (b) Automobiles and Parts
(c) Banks (d) Construction and Materials
Figure 3.7: Distributions of Price/Earnings ratio for selected sectors.
A concluding example we want to study is that of the Price-of-earnings ratio. The P/E ratio is one of the most common fundamentals that investors analyze to evaluate stock prices. The P/E ratio measures at what multiple of its earnings a stock is valued and currently traded. Therefore, everything else equal, a lower P/E ratios is typically indicating an undervalued stock. Since earnings can potentially be negative or zero in the short run, P/E ratios can theoretically be negative or go to infinity, but those scenarios, as in this case, are often avoided and thus the distributions start at zero. The P/E ratio distributions for the “Aerospace and Defense” sector and the “Fixed Line Telecom- munications” resemble each other. They both peak around a ratio of 20, but also have multiple outliers at the upper end. The “Banks” sector is characterized by a low peak in P/E ratios and also has lower maximum P/E ratios. The P/E ratios are consequently sector specific. Chapter 3. Methodology 15
3.3.2 Joint Distributions The distribution analysis has provided valuable insights into the characteristics of different sectors and fundamentals, but was not able to show a relation between fundamental data and a firm’s per- formance. This chapter studies joint distributions for sector fundamentals and corresponding stock performances during the quarter. We can reuse the fundamental data distributions from Chapter 3.3.1 and add a performance indicator. As the performance indicator for a stock’s fundamental value we use the price return, defined as the price increase measured in percent, of the respective stock over the quarter that followed the publication of the fundamental data. Then, we can plot the return of each stock in the sector for every quarter in the 30-year period over the reported fundamental data of the same quarter to see if specific values of fundamental data trigger a positive or a negative return. Figure 3.8 is an example of this process for the EV/EBITDA fundamental in the “Aerospace and Defense” sector and shows that there is a negative correlation between the multiple and stock performance.
Figure 3.8: Scatter plot with trend line of returns over the EV/EBITDA ratio values for the “Aerospace and Defense” sector.
In fact, we can see that there is a trend between the fundamental, in this case the Enterprise Value divided by the EBITDA, and the quarterly return of the stocks in the “Aerospace and Defense” sector. The regression coefficient is 0.6%, which means that for a one unit increase of the multiple, the return falls by 0.6% on average. Corporations that report high EV/EBITDA ratios, on average, have lower returns over the following quarter. This is intuitive, since firms with high valuations, expressed through a high EV/EBITDA, should tend to have lower performances than undervalued stocks. To study that behaviour in more detail and verify whether the trends we see are actually significant, we split up the plot above in 6 bins and study the relation between fundamental data and return for each of the bins individually. For each bin we run a linear regression through the data points and highlight the bins with significant trends. To check whether a trend is significant we conduct a statistical t-test for each bin. We set the null hypothesis as: H0 : The return is independent of the fundamental data. (3.5) To test the null hypothesis, we randomly shuffle the return values against its fundamental data, so that the return data of a quarter does not match its fundamental data anymore. Then we rerun the regression and note the slope of the regression. This process is repeated for 1000 times. We then compare the slope of the original regression with the randomized simulations’ slopes. After doing a two-sided t-test with a significance level of 5%, we reject the null hypothesis if the slope of the original regression is larger/lower than for the 50 highest/lowest random simulations. The statistics concerning the t-tests for all joint distribution can be found in Appendix 16 3.3. Ensemble Properties of the Financial Ratios
The bins that show a significant trend according to that model are highlighted:
Enterprise Value/EBITDA
(a) Aerospace and Defense
(b) Food Producers
(c) Life Insurance
(d) Software and Computer Services
Figure 3.9: Joint distributions of selected sectors for the EV/EBITDA multiple. The graphs have been split to analyze behaviour for shorter intervals of the EV/EBITDA multiple. Bins with significant trends according to a t-test have been highlighted with blue points and a red line.
The first joint distribution illustrates the relationship between the returns of several sectors and the “Enterprise Value / EBITDA” multiple. As we have already seen, the returns seem to negatively correlate with the ratio. This is especially true for the first bin. For small values of the multiple an increase leads to a more significant reduction in returns. This could be because we use a linear x-axis for the fundamentals values and thus relative changes of the ratio are higher for small values. Chapter 3. Methodology 17
P/E ratio
(a) Financial Services
(b) Food Producers
(c) Household Goods and Home Construction
(d) Personal Goods
Figure 3.10: Joint distributions of selected sectors for the Price/Earnings ratio. The graphs have been split to analyze behaviour for shorter intervals of the P/E ratio. Bins with significant trends according to a t-test have been highlighted with blue points and a red line.
The second example displays the influence of the P/E ratio on the return. The P/E ratio similarly to the EV/EBITDA multiple sets the value of a stock in relation to its profits. Therefore, it is not surprising that the behaviour is comparable. Overall, a rising P/E ratio is associated with lower returns, especially in the first bins. The “Food Producer” sector shows strong dependencies. 18 3.3. Ensemble Properties of the Financial Ratios
3.3.3 Canonical Averaging of the Volatility and Return Time Series con- ditional on Financial Ratios
To further sharpen the picture, we can add a time axis to the previous representations. Instead of plotting quarterly returns over fundamentals we can plot the cumulative return over several days in the beginning of the quarters over the fundamentals. The cumulative return for a given quarter starts at zero for the day of the fundamental publication and is then computed for the following 40 days. The cumulative return is defined as:
t RC (t)= r(t), (3.6) n=0 Y where r(t) is the daily return of day t and r(0) = 1. The x-axis displays the sorted fundamental values, the y-axis shows the days for which the return is calculated, and the coloring indicates the magnitude of the cumulative returns, where the colors range from blue for low returns to red for high returns. To make the heat maps easier to understand, the scattered data has been binned and interpolated. Additionally, we can create similar plots for the volatility of the stock returns by replacing the cumulative returns with moving volatilities. The moving volatilities for a given day are defined as the standard deviation of the daily returns of a range of two days before and two days after that day: 2(t) = Var(r(t N),..,r(t),..,r(t + N)) (3.7) with N =2. Similarly, the x-axis displays the sorted fundamental values, the y-axis shows the days for which the moving volatility is calculated, and the coloring indicates the magnitude of the volatility, where the colors range from blue for low volatility to red for high volatility. The advantage of the heat maps is that we are able to study the return time series during the quarter right after new fundamental data was reported. The goal of that study is to identify specific trends and performance behaviours, that are triggered by specific fundamental values, and could be useful insights to be incorporated into the portfolios. Chapter 3. Methodology 19
Dividend yield
Figure 3.11: Heat maps displaying the return and volatility behaviour for the first 40 days after reporting seasons, in addition to the reported dividend yields.
The heatmaps in Figure 3.11 display the cumulative return and the volatility for dividend yields. One can see that there is a strong dependence between the cumulative return and the volatility of the stocks, which is not surprising with respect to our definition of the short-term volatility. Interestingly, we see that high cumulative returns often come in cycles in which high return days are followed by lower return days. Therefore, we can see that even overall well performing quarters do not accumulate their return constantly, but rather gain and loose it in the beginning of the quarter until it eventually reaches an equilibrium. The “Financial Services” sector is a good example for this phenomenon. Ultimately, we do see that there are particular dividend values for which each sector performs well, those values are not necessarily the highest dividend yields. 20 3.3. Ensemble Properties of the Financial Ratios
Revenue/Total Assets
Figure 3.12: Heat maps displaying the return and volatility behaviour for the first 40 days after reporting seasons, in addition to the reported Revenue/Asset multiples.
The implications of the “revenue-tot-assets” plots are in line with expectations: High revenue ratios indicate good future performances. Similar to the example above, we see a cyclical behaviour for the cumulative return over time. The days on which the local maxima and minima occur are even consistent among different sectors. Again, we see that the cumulative return behaves in cycles and markets need time to find their equilibrium price. This fact seems to contradict the market efficiency hypothesis, which states that markets quickly find an equilibrium after new information has been made available. It should be noted, that since we do not know which other factors have driven the performance of the stocks in that time, and the cycles might have been caused by influences that do not occur in the fundamentals, there could be plenty of explanations that justify that behaviour even under the efficient market hypothesis. Chapter 3. Methodology 21
3.4 Copula Analysis
3.4.1 Introduction At last, we use a Copula analysis to study the relationships between different fundamentals, and fundamentals and future returns. Copulas can be used to model “the dependence structures between stochastic variables” (Papaioan- nou et al., 2016) and have gained popularity in the financial industry for risk management and asset pricing. Especially, the Gaussian copula was widely used for credit derivative pricing before the Great Financial crisis (Li, 2000) and has been proven to be a valid model for stock return dependencies by Sornette et al. (2003). We do not model the return dependencies between different assets but between fundamentals and assets, as well as fundamentals and fundamentals, and it is not clear yet, which Copula is the best fit for the data set, as there are potentially several copulas fitting the data. In general, Copulas can be defined as multivariate distribution functions with uniform one-dimensional margin distributions (Nelsen, 1999). This analysis focuses on bivariate copulas only, which are defined as follows. If
FXY (x, y)=C (FX (x),FY (y)) , (3.8) where X, Y are random variables, FX (x),FY (y) are the marginal distribution functions and FXY (x, y) is the joint distribution function of X, Y ,thencopulaisthefunctionC that satisfies C(t, 0) = C(0,t)=0and C(t, 1) = C(1,t)=t for any t [0, 1] (Papaioannou et al., 2016). 2
Gaussian Copula
For the Gaussian Copula, this can be rewritten as
1 1 C(u, v; %):= 2 (u), (v); % , (3.9) where is the distribution function of the standard normal distribution and 2 is the distribution function of the bivariate standard normal distribution with correlation ⇢.AGaussiancopulais completely defined by its correlation matrix ⇢ and is not tail-dependent (Sornette et al., 2003; Meyer, 2013). 22 3.4. Copula Analysis
Student Copula
Another copula that we will fit to the data is the Student copula, which can be defined for bivariate distributions as
1 1 C(u, v; ✓)= G (u), (v); ✓ (v+2) 1 1 tv (u) tv (v) dy dx x2 2✓xy + y2 2 (3.10) = 1+ , 2⇡ (1 ✓2)1/2 v (1 ✓2) Z 1 Z 1 ⇢ where ✓ is the linear correlation coefficient and v is the degree of freedom of the t-distribution, the CDF is defined as tv(.) (Salleh et al., 2016).
Important measures to identify the dependence between two distributions are correlation coeffi- cients. We define the most common correlation coefficients associated with copulas in the following sections.
Pearson’s Correlation Coefficient
Pearson’s coefficient is the most common correlation coefficient and is calculated by
Cov(X, Y ) E[XY ] E[X]E[Y ] ⇢X,Y = = , (3.11) Var(X) Var(Y ) E[X2] [E[X]]2 E[Y 2] [E[Y ]]2 where Cov(.), Var(.) andp E[.] denotep the covariance,p the variancep and the expectation respectively. X, Y are a pair of random variables. The coefficient is however, a linear correlation coefficient, “since linear correlation is not a copula- based measure of dependence, it can often be quite misleading and should not be taken as the canonical dependence measure.” (Embrechts et al., 2001)
Kendall’s tau
Kendall’s tau is a correlation metric based on concordance and discordance. We use the defintion of concordance and discordance from the “Encyclopedia of Mathematic” (Nelsen, 2001). If (x ,y ) and (x ,y ) are two elements of a sample (x ,y ) n from a bivariate population, one j j k k { i i }i=1 says that (xj,yj) and (xk,yk) are concordant if xj Then tau can be defined as: ( number of concordant pairs ) ( number of discordant pairs ) ⌧ = , (3.12) n 2 ✓ ◆ . where is the binominal coefficient. . ✓ ◆ Chapter 3. Methodology 23 Spearman’s rho Spearman’s rho is the Pearson coefficient of rank variables and is defined as Cov(rg(X),rg(Y )) ⇢S = , (3.13) Var(rg(X)) Var(rg(Y )) where rg(.) is the rank of a variable andp X, Y are randomp variables. Kendall’s tau and Spearman’s rho are preferable correlation coefficients for the copula analysis and will be calculated alongside the linear Pearson’s correlation for the following copulas (Embrechts et al., 2001). Kolmogorov-Smirnov distance The Kolmogorov-Smirnov distance can be used to measure the fit between two distributions. The distance describes the deviation between an empirical distribution of actual observations and a hy- pothesized distribution (Kole et al., 2007). In our case, the empirical distribution is the cumulative distribution function of our observations and the hypothesized distribution is the function of the fitted copula. The distance can be calculated as: m DKS = max FE (xt) FH (xt) (3.14) t | | and the average as: Da = F (x) F (x) dF (x), (3.15) KS | E H | H Zx where FE is the empirical distribution function and FH is the hypothesized distribution. Anderson-Darling distance Another distance measure to estimate fits between distributions is the Anderson-Darling distance (Anderson and Darling, 1952). The Anderson-Darling distance gives more weights to the tails of the distribution than the Kolmogorov-Smirnov distance. The distance is defined as: m FE (xt) FH (xt) DAD = max | | (3.16) t F (x )(1 F (x )) H t H t p and its average as: a FE(x) FH(x) DAD = | | dFH(x) (3.17) x F (x)(1 F (x)) Z H H p where again FE is the empirical distribution function and FH is the hypothesized distribution. 24 3.4. Copula Analysis 3.4.2 Calibration For the practical implementation of the copula analysis we use the python copulae package, which allows to fit data to several copulas including the Gaussian and the Student copulas, and also provides additional statistics including a goodness-of-fit test, which we use to filter the copulas. Since we have several features per sector whose dependencies can be studied both pairwise and in relation to the sector returns, the number of copulas we can potentially create reaches thousands. Therefore, we can neither display all the copulas in the thesis nor in the appendix and will only provide a selection of the best copulas in terms of fit and correlation. We focus on the Gaussian copula that has been proven to be a good choice for the study of financial assets (Sornette et al., 2003). Nevertheless, since we have such a large data set, there are many features that fit several copulas. The following chapter provides a selection of informative copulas. For each copula we provide Pearson’s correlation coefficient ⇢, which completely defines Gaussian copulas, Kendall’s tau, Spearman’s rho and the p value of the goodness-of-fit test. The first copulas display the relationships between fundamentals and the second part studies the influence of fundamentals on the future returns of a given sector. Therefore, we again match the fundamentals and returns by quarters as in Chapter 3.3.2 for the joint distributions. Gaussian Copulas between Fundamentals (a) Financial Services (b) Industrial Engineering (c) Industrial Transportation (d) Life Insurance Figure 3.13: Gaussian copulas for reinvestment rate and return-on-assets/return-on-equity. Addi- tionally, the Pearson’s, Kendall’s and Spearman’s correlation coefficients are displayed. The null hypothesis of the goodness-of-fit test is that the copulas are fitting. Chapter 3. Methodology 25 (a) Household Goods and Home Construction (b) Industrial Engineering (c) Life Insurance (d) Nonlife Insurance Figure 3.14: Gaussian copulas for reinvestment rate and EBITDA. Additionally, the Pearson’s, Kendall’s and Spearman’s correlation coefficient are displayed. The null hypothesis of the goodness- of-fit test is that the copulas are fitting. For the copulas between fundamentals, we can find several with high correlations and good-fits. It is to be noted though, that many fundamentals, especially financial ratios, can be converted into each other and are therefore not just highly correlated as the metrics would imply, but rather identical. Since those fundamentals do not contain any additional information and the observed correlations are trivial, we checked all fundamental combinations and avoided copulas that measure identical fundamentals. The copulas above display the dependencies between the reinvestment rate of firms within a sector and profitability ratios of those firms, like EBITDA multiples and Return-on-Equity/Assets. We find that in general, the reinvestment rate correlates with the profitability of the firms, especially the copulas for the ROE/ROA show strong dependencies. This observation is not surprising, because reinvestments are usually financed from firms’ profits and the reinvestment rate can therefore be increased for higher profits. Unfortunately, the copulas cannot tell us about the underlying causalities. We do not know if the reinvestments are completely dependent on the profits, or if we can also conclude that firms with high reinvestment rates tend to be more profitable in the long run. 26 3.4. Copula Analysis Positive Correlations between Fundamentals and Returns (a) Financial Services: Dividend yield (b) Fixed Line Telecomm: Reinvestment rate (c) Nonlife Insurance: EBITDA/Equity (d) Nonlife Insurance: Reinvestment rate (e) Oil and Gas Producers: Reinvestment rate (f) Personal Goods: Sales receivables (g) Software & Computer Services: EBIT- (h) Support Services: Reinvestment rate DA/Assets Figure 3.15: Gaussian copulas for fundamentals and positive returns. Additionally, the Pear- son’s, Kendall’s and Spearman’s correlation coefficients are displayed. The null hypothesis of the goodness-of-fit test is that the copulas are fitting. Chapter 3. Methodology 27 Figure 3.15 shows copulas with positive correlations between fundamentals and stock returns. In general, the correlations between a single fundamental and the return of a stock are small, which is not astonishing, because stock returns are driven by a large amount of factors, of which fundamentals are just a small part. Nevertheless, there are several fundamentals that possess positive correlation with returns like dividends, reinvestment rates, EBITDA ratios and sales receivables. Encouragingly, the correlations between the fundamentals and the return that we see above are in line with expectations: • High dividends attract investors; • Firms that have high reinvestment rates are on a growth track; • High EBITDA ratios highlight the profitability of a firm; • Sales receivables indicate a high demand for a firm’s goods and services and thus future income. All of the points above should lead to higher returns, as the copulas indicate Graham and Dodd (1934). Negative Correlations between Fundamentals and Returns We do the same analysis for fundamentals that negatively correlate with future stock returns. The correlations between fundamentals and negative returns are higher in magnitude than for the experiment above with positive correlations. The highest positive correlation found is 0.17, whereas there are seven negative fundamental-return pairs with correlations above that level. The relations are especially strong for P/E, EV/EBITDA and P/B ratios, as one can see in Figure 3.16 below. These correlations are also in line with expectations, since higher price multiples tend to indicate an overvaluation of stocks which should result in lower returns. This seems to be especially true for the “Construction and Materials” sector. 28 3.4. Copula Analysis (a) Construction and Materials: EV/EBITDA (b) Construction and Materials: P/E ratio (c) Financial Services: P/E ratio (d) Fixed Line Telecomm: P/B ratio (e) Life Insurance: P/B ratio (f) Nonlife Insurance: P/E ratio (g) Personal Goods: EV/Revenue (h) Software and Computer Services: EV/Revenue Figure 3.16: Gaussian copulas for fundamentals and negative returns. Additionally, the Pear- son’s, Kendall’s and Spearman’s correlation coefficients are displayed. The null hypothesis of the goodness-of-fit test is that the copulas are fitting. Chapter 3. Methodology 29 3.5 Random Forest Model 3.5.1 Mathematical Formulation Before we can start using a random forest model for our experiments, we first need to provide a mathematical formulation for our problem: Let S be a stock with daily prices P (t), where t are all the days in the 30-year period and thus t 2 [1, 7560].Wedefineaquarterq as a set of consecutive days t,andF (q) as the set of fundamentals of stock S reported just before quarter q. Therefore, all days t q follow the fundamental reporting. 2 Further, we need to define a prediction target for the random forest predictor, which is usually a metric based on the prices of a stock as we saw in Chapter 3.2 and is calculated per quarter. Therefore, we define our quarterly prediction target (q) as a function of P (t).