**Inquire Europe’s 2019 autumn seminar in Krakow, Poland, brought together some 100 investment professionals and academics to discuss recent advances in “Investing with Machine Learning and New Techniques”. Part 2 (of 3) covers using deep learning to build asset pricing models.**

#### Deep learning and asset pricing models

Following our first post, we now discuss the “Deep Learning in Characteristics-Sorted Factor Models” paper of Guanhao (Gavin) Feng from __City University of Hong Kong. This paper __proposes a departure from machine learning research that attempts to forecast directly financial asset returns and stumbles on the problem of a low signal-to-noise ratio in such returns. Instead, and to increase the chances of success, Gavin presented a bottom-up approach based on deep learning applied to the construction of asset pricing models, which include firm characteristics [inputs], risk factors [intermediate features] and security returns [outputs].

Examples of such models for stock returns include the Capital Asset Pricing Model (CAPM), with just the market factor, the __Fama-French models__ add two and four factors over CAPM, and the Carhart model adds three factors over CAPM . The question addressed concerned using machine learning to build or improve such models to explain the cross-sectional average returns, where the signal-to-noise ratio is relatively high.

Gavin highlighted that researchers build asset pricing models by looking for long-short factors on firm characteristics, such as size, value and __momentum,__ which can be used to predict future stocks returns. If a factor gets it right, the long-short strategy delivers stable risk premia that is not captured by other commonly used benchmarks.

Thus, an easy way to demonstrate the predictive power of the factors (or smart beta) is to use them to sort stocks and create investable long-short portfolios. The factor strategy that buys the top 10% or 20% of stocks returns and sells short the bottom 10% or 20% of stocks must generate positive and significant average returns over time. Those factors are said to pay a factor premium. Also, the beta (covariance) of the factors should help explain the cross-sectional average returns.

#### What makes an asset pricing model good?

In Merton’s Intertemporal Capital Asset Pricing Model (ICAPM), an asset pricing model is considered good when it relies on such factors that are exhaustive in explaining stock and portfolio returns. The returns and average returns of any stock or portfolio can be well explained by a mimicking linear combination of the factors in the model, i.e. the pricing errors, or alphas, should average zero over time. A good asset pricing model minimises pricing errors for all possible portfolios. Investment practitioners seeking for alternative alphas look for new factors that are not yet explained by existing asset pricing models.

What researchers typically do is to use many characteristics and search for a parsimonious factor model, such as Fama-French models, that leads to pricing errors close to zero. However, the academic research still fails to find the perfect factor model to explain all existing alphas. In this paper, Gavin argues that this approach suffers from a major drawback because the characteristics calculation is relatively ad hoc and highly sensitive by the original academic research and data availability. For example, in the Carhart model, the momentum factor is based on one year return momentum winner versus loser stocks. But there are other possible momentum measures: 3-, 6-, and 24-month momentum have been proposed by other authors. In the long-short portfolio components, many of the stocks are commonly picked by different momentum measures, but some stocks are not.

Even if this is, perhaps, not exactly true since traditional researchers are likely to experiment with different specifications of stock characteristics after seeing the outcome of a first specification, this can be automated with a deep learning model. The algorithm is asked to learn iteratively until the objective is reached: bring pricing errors down and close to zero. Using what is known as backpropagation, the model can be refitted sequentially with the feedback that is obtained from the changes in the pricing errors at every step in the model learning process.

#### How to set up a deep learning framework to construct such models?

The framework proposed starts by looking at an asset pricing model such as the Fama-French five-factor model through the eyes of a data scientist. Gavin has published their algorithm with a data example on his website. In their paper, he shows that the characteristics (size, value, etc.) can be seen as inputs into a neural network.

Reproduced with permission

*Source: “Deep Learning in Characteristics-Sorted Factor Models”.*

- Inputs are firm characteristics. The neural network starts from sorting securities on firm characteristics, which is a linear activation to create long-short portfolio weights.
- Intermediate features are risk factors. The factors are linear activations (long-short portfolio weights) on realized returns from the sorting directions.
- Outputs are security returns. Minimizing an economic objective function is equivalent to minimizing pricing errors for fitting the factor model to portfolio or individual stock returns.

Gavin used data from 1975 through 2017 for 3 000 stocks and a universe of factors that included all main categories: market beta, book-to-market ratio, dividend yield, earning-price ratio, asset growth, operating profitability, return on equity, volatility of returns, 12-month momentum and others. They train their model using bivariate-sorted portfolios, and test the out-of-sample model fitting on other test assets, such as industry portfolios and S&P 500 individual stock returns.

#### In-sample improvements, but more research needed for out-of-sample

Gavin shows positive and consistent in-sample improvement for model fitting using different criteria such as the time series R2, the average pricing errors, and the cross-sectional R2. For the latter two measures, these results are surprising because adding more factors should only help to increase time series R2. Also, to interpret the deep learning factors, Gavin shows a significant improved Sharpe ratio and uses the augmented factor model to explain more existing factors. But these results are all in-sample results. Gavin’s paper mainly studies in-sample properties of the asset pricing model and uses deep learning as an optimization kernel. Thus, more research on out-of-sample forecasting using deep learning is still needed.

In all, we see this as an interesting idea, but the results are not yet sufficiently encouraging. At least for the time being we are more inclined to rely on machine learning classification algorithms such as clustering as a tool for searching through factors even if this involves less automation and more pragmatism: it is easier to investigate the economic sense of factors as well as to research changes in factor correlations over time.

That is why we have been relying on those for our own proprietary factor models for both equity and corporate bond portfolios.

Also read: 2019 Inquire Europe seminar (1/3): Machine learning and new techniques

To discover our funds and select the ones that meet your requirements, click here >

For more articles on quantitative investing, click here >

For more articles by Raul Leote de Carvalho, click here >

Any views expressed here are those of the author as of the date of publication, are based on available information, and are subject to change without notice. Individual portfolio management teams may hold different views and may take different investment decisions for different clients.