Deep Learning in Asset Pricing

Similar documents
Applied Macro Finance

Application of Deep Learning to Algorithmic Trading

Optimal Portfolio Inputs: Various Methods

Arbitrage Pricing Theory and Multifactor Models of Risk and Return

Hedging Factor Risk Preliminary Version

International Journal of Computer Engineering and Applications, Volume XII, Issue II, Feb. 18, ISSN

International Journal of Computer Engineering and Applications, Volume XII, Issue II, Feb. 18, ISSN

Applied Macro Finance

An analysis of momentum and contrarian strategies using an optimal orthogonal portfolio approach

Foreign Exchange Forecasting via Machine Learning

Deep Learning for Time Series Analysis

Common Macro Factors and Their Effects on U.S Stock Returns

Economics of Behavioral Finance. Lecture 3

On the economic significance of stock return predictability: Evidence from macroeconomic state variables

The Effect of Kurtosis on the Cross-Section of Stock Returns

Optimal Debt-to-Equity Ratios and Stock Returns

What is the Expected Return on a Stock?

Growth Opportunities, Investment-Specific Technology Shocks and the Cross-Section of Stock Returns

Lecture 3: Factor models in modern portfolio choice

Estimating Latent Asset-Pricing Factors

A Sensitivity Analysis between Common Risk Factors and Exchange Traded Funds

Market Timing Does Work: Evidence from the NYSE 1

FE670 Algorithmic Trading Strategies. Stevens Institute of Technology

STOCK MARKET PREDICTION AND ANALYSIS USING MACHINE LEARNING

distribution of the best bid and ask prices upon the change in either of them. Architecture Each neural network has 4 layers. The standard neural netw

Introduction to Asset Pricing: Overview, Motivation, Structure

NBER WORKING PAPER SERIES A REHABILITATION OF STOCHASTIC DISCOUNT FACTOR METHODOLOGY. John H. Cochrane

Real Time Macro Factors in Bond Risk Premium

Tuomo Lampinen Silicon Cloud Technologies LLC

A. Huang Date of Exam December 20, 2011 Duration of Exam. Instructor. 2.5 hours Exam Type. Special Materials Additional Materials Allowed

Principles of Finance

Why Surplus Consumption in the Habit Model May be Less Pe. May be Less Persistent than You Think

Regularizing Bayesian Predictive Regressions. Guanhao Feng

Final Exam Suggested Solutions

Statistical Understanding. of the Fama-French Factor model. Chua Yan Ru

Market Risk Analysis Volume I

CS221 Project Final Report Deep Reinforcement Learning in Portfolio Management

Financial Mathematics III Theory summary

Department of Finance Working Paper Series

Arbitrage Asymmetry and the Idiosyncratic Volatility Puzzle

Chapter 5 Univariate time-series analysis. () Chapter 5 Univariate time-series analysis 1 / 29

$tock Forecasting using Machine Learning

k-layer neural networks: High capacity scoring functions + tips on how to train them

Asset Pricing Anomalies and Time-Varying Betas: A New Specification Test for Conditional Factor Models 1

arxiv: v1 [econ.em] 4 Feb 2019

The Econometrics of Financial Returns

Applied Macro Finance

Can Hedge Funds Time the Market?

Economics 424/Applied Mathematics 540. Final Exam Solutions

Online Appendix for. Short-Run and Long-Run Consumption Risks, Dividend Processes, and Asset Returns

Implied Funding Liquidity

An Online Appendix of Technical Trading: A Trend Factor

CHAPTER 10. Arbitrage Pricing Theory and Multifactor Models of Risk and Return INVESTMENTS BODIE, KANE, MARCUS

Overview of Concepts and Notation

Smart Beta #

The bottom-up beta of momentum

Prospective book-to-market ratio and expected stock returns

SOLUTION Fama Bliss and Risk Premiums in the Term Structure

Risk Premia and the Conditional Tails of Stock Returns

Introduction to Algorithmic Trading Strategies Lecture 9

Improving Returns-Based Style Analysis

Lecture 2: Stochastic Discount Factor

COMPARING NEURAL NETWORK AND REGRESSION MODELS IN ASSET PRICING MODEL WITH HETEROGENEOUS BELIEFS

Empirical Study on Five-Factor Model in Chinese A-share Stock Market

Dynamic Asset Pricing Model

What Drives the Earnings Announcement Premium?

Index Models and APT

GDP, Share Prices, and Share Returns: Australian and New Zealand Evidence

Factor models in empirical asset pricing

Liquidity Creation as Volatility Risk

Bayesian Dynamic Linear Models for Strategic Asset Allocation

Solving dynamic portfolio choice problems by recursing on optimized portfolio weights or on the value function?

arxiv: v2 [stat.ml] 19 Oct 2017

Statistical Models and Methods for Financial Markets

Stock Price and Index Forecasting by Arbitrage Pricing Theory-Based Gaussian TFA Learning

Liquidity Creation as Volatility Risk

Time-variation of CAPM betas across market volatility regimes for Book-to-market and Momentum portfolios

Liquidity Creation as Volatility Risk

Consumption- Savings, Portfolio Choice, and Asset Pricing

Asset Pricing and Excess Returns over the Market Return

OPTIMAL RISKY PORTFOLIOS- ASSET ALLOCATIONS. BKM Ch 7

A Lottery Demand-Based Explanation of the Beta Anomaly. Online Appendix

Problem Set 3. Thomas Philippon. April 19, Human Wealth, Financial Wealth and Consumption

Internet Appendix to The Booms and Busts of Beta Arbitrage

P1.T1. Foundations of Risk Management Zvi Bodie, Alex Kane, and Alan J. Marcus, Investments, 10th Edition Bionic Turtle FRM Study Notes

CHAPTER 10. Arbitrage Pricing Theory and Multifactor Models of Risk and Return INVESTMENTS BODIE, KANE, MARCUS

Estimating Asset Pricing Factors from Large-Dimensional Panel Data

MEASURING PORTFOLIO RISKS USING CONDITIONAL COPULA-AR-GARCH MODEL

Basics of Asset Pricing. Ali Nejadmalayeri

Lecture 5. Predictability. Traditional Views of Market Efficiency ( )

Problem Set 4 Solutions

Journal of Economics and Financial Analysis, Vol:1, No:1 (2017) 1-13

Asset Selection Model Based on the VaR Adjusted High-Frequency Sharp Index

Does the Fama and French Five- Factor Model Work Well in Japan?*

Labor-Technology Substitution: Implications for Asset Pricing. Miao Ben Zhang University of Southern California

On modelling of electricity spot price

Risk-Adjusted Capital Allocation and Misallocation

Common Risk Factors in the Cross-Section of Corporate Bond Returns

Markowitz portfolio theory

One-Factor Asset Pricing

Transcription:

Deep Learning in Asset Pricing Luyang Chen 1 Markus Pelger 1 Jason Zhu 1 1 Stanford University November 17th 2018 Western Mathematical Finance Conference 2018

Motivation Hype: Machine Learning in Investment Same reporter 3 weeks later Efficient markets: Asset returns dominated by unforecastable news Financial return data has very low signal-to noise ratio This paper: Including financial constraints (no-arbitrage) in learning algorithm significantly improves signal 1

Motivation Motivation: Asset Pricing The Challenge of Asset Pricing One of the most important questions in finance: Why are asset prices different for different assets? No-Arbitrage Pricing Theory: Stochastic discount factor SDF (also called pricing kernel or equivalent martingale measure) explains differences in risk and asset prices Fundamental question: What is the SDF? Challenges SDF should depend on all available economic information: Very large set of variables Functional form of SDF unknown and likely complex SDF needs to capture time-variation in economic conditions Risk premium in stock returns has a low signal-to-noise ratio 2

Motivation This paper Goals of this paper: General non-linear asset pricing model and optimal portfolio design Deep-neural networks applied to all U.S. equity data and large sets of macroeconomic and firm-specific information. Why is it important? 1 Stochastic discount factor (SDF) generates tradeable portfolio with highest risk-adjusted return (Sharpe-ratio=expected excess return/standard deviation) 2 Arbitrage opportunities Find underpriced assets and earn alpha 3 Risk management Understand which information and how it drives the SDF Manage risk exposure of financial assets 3

Motivation Contribution of this paper Contribution This Paper: Estimate the SDF with deep neural networks Crucial innovation: Include no-arbitrage condition in the neural network algorithm and combine four neural networks in a novel way Key elements of estimator: 1 Non-linearity: Feed-forward network captures non-linearities 2 Time-variation: Recurrent (LSTM) network finds a small set of economic state processes 3 Pricing all assets: Generative adversarial network identifies the states and portfolios with most unexplained pricing information 4 Dimension reduction: Regularization through no-arbitrage condition 5 Signal-to-noise ratio: No-arbitrage conditions increase the signal to noise-ratio General model that includes all existing models as a special case 4

Motivation Contribution of this paper Empirical Contributions Empirically outperforms all benchmark models. Optimal portfolio has out-of-sample annual Sharpe ratio of 2.15. Non-linearities and interaction between firm information matters. Most relevant firm characteristics are price trends, profitability, and capital structure variables. Shallow learning outperforms deep-learning. 5

Motivation Literature (partial list) Deep-learning for predicting asset prices Gu, Kelly and Xiu (2018) Feng, Polson and Xu (2018) Messmer (2017) Predicting future asset returns with feed forward network Linear or kernel methods for asset pricing of large data sets Lettau and Pelger (2018): Risk-premium PCA Feng, Giglio and Xu (2017): Risk-premium lasso Freyberger, Neuhierl and Weber (2017): Group lasso Kelly, Pruitt and Su (2018): Instrumented PCA 6

Model The Model No-arbitrage pricing Ri,t+1 e = excess return (return minus risk-free rate) at time t + 1 for asset i = 1,..., N Fundamental no-arbitrage condition: for all t = 1,..., T and i = 1,..., N E t [M t+1 R e i,t+1] = 0 E t [.] expected value conditioned on information set at time t M t+1 stochastic discount factor SDF at time t + 1. Conditional moments imply infinitely many unconditional moments for any F t -measurable variable I t E[M t+1 R e t+1,ii t ] = 0 7

Model The Model No-arbitrage pricing Without loss of generality SDF is projection on the return space M t+1 = 1 + N w i,t Ri,t+1 e i=1 Optimal portfolio N Sharpe-ratio i=1 w i,tr e i,t+1 has highest conditional Portfolio weights w i,t are a general function of macro-economic information I t and firm-specific characteristics I i,t : w i,t = w(i t, I i,t ), Need non-linear estimator with many explanatory variables! Use a feed forward network to estimate w i,t 8

Estimation Loss Function Objective Function for Estimation Estimate SDF portfolio weights w(.) to minimize the no-arbitrage moment conditions For a set of conditioning variables Î t the loss function is L(Ît) = 1 N N T ( i 1 T i 2. M t+1 R e T T i,t+1ît) i i=1 t=1 Allows unbalanced panel. How can we choose the conditioning variables Ît = f (I t, I i,t ) as general functions of the macroeconomic and firm-specific information? Generative Adversarial Network (GAN) chooses Ît! 9

Estimation Generative Adversarial Network (GAN) Determining Moment Conditions Two networks play zero-sum game: 1 one network creates the SDF M t+1 2 other network creates the conditioning variables Î t Iteratively update the two networks: 1 for a given Ît the SDF network minimizes the loss 2 for a given SDF the conditional networks finds Ît with the largest loss (most mispricing) Intuition: find the economic states and assets with the most pricing information 10

Estimation Recurrent Neural Network (RNN) Transforming Macroeconomic Time-Series Problems with economic time-series data Time-series data is often non-stationary transformation necessary Asset prices depend on economic states simple differencing of non-stationary data not sufficient Solution: Recurrent Neural Network (RNN) with Long-Short-Term Memory (LSTM) cells Transform all macroeconomic time-series into a low dimensional vector of stationary state variables 11

Estimation Example: Non-stationary Macroeconomic Variables Macroeconomic Variables 9.6 7.5 9.4 7.0 9.2 6.5 log RPI 9.0 8.8 log S&P500 6.0 5.5 8.6 5.0 8.4 4.5 1974 1979 1984 1989 1994 1999 2004 2009 2014 4.0 1974 1979 1984 1989 1994 1999 2004 2009 2014 (a) Log RPI (b) Log S&P500 12

Estimation Macroeconomic state processes 1.00 0.75 0.50 Train Valid Test 0.75 0.50 0.25 Macro_0 0.25 0.00 0.25 Macro_2 0.00 0.25 0.50 0.50 0.75 1970 1980 1990 2000 2010 0.75 1.00 Train Valid Test 1970 1980 1990 2000 2010 0.75 Train Valid Test 1.00 0.75 Train Valid Test 0.50 0.50 0.25 0.25 Macro_1 0.00 Macro_3 0.00 0.25 0.25 0.50 0.50 0.75 0.75 1970 1980 1990 2000 2010 1970 1980 1990 2000 2010 Figure: Macroeconomic state processes (LSTM Outputs) based on 178 macroeconomic time-series. 13

Estimation Neural Networks Model Architecture SDF Network: Update parameters to minimize loss State RNN '! $ Feed Forward Network ) ",$ Construct SDF! %,,! $! ",$ * $+% Moment RNN /! $ Conditional Network: Update parameters to maximize loss Feed Forward Network (! $ Loss Calculation -, $+%. Iterative Optimizer with GAN 14

Data Data Data 50 years of monthly observations: 01/1967-12/2016. Monthly stock returns for all U.S. securities from CRSP (around 31,000 stocks) Use only stocks with with all firm characteristics (around 10,000 stocks) 46 firm-specific characteristics for each stock and every month (usual suspects) I i,t normalized to cross-sectional quantiles 178 macroeconomic variables (124 from FRED, 46 cross-sectional median time-series for characteristics, 8 from Goyal-Welch) I t T-bill rates from Kenneth-French website Training/validation/test split is 20y/5y/25y 15

Data Benchmark models Benchmark models 1 Linear factor models (CAPM, Fama-French 5 factors) 2 Instrumented PCA (Kelly et al. (2018): estimate SDF as linear function of characteristics: w i,t = θ I i,t 3 Deep learning return forecasting (Gu et al. (2018)): Predict conditional expected returns E t [R i,t+1 ] Empirical loss function for prediction 1 NT N i=1 t=1 T (R i,t+1 g(i t, I i,t+1 )) 2 Use only simple feedforward network for forecasting Optimal portfolio: Long-short portfolio based on deciles of highest and lowest predicted returns 16

Results Results - Sharpe Ratio Sharpe Ratios of Benchmark Models Model SR (Train) SR (Valid) SR (Test) FF-3 0.27-0.09 0.19 FF-5 0.46 0.37 0.22 IPCA 1.05 1.17 0.47 RtnFcst 0.63 0.41 0.27 17

Results Results - Sharpe Ratio Table: Performances of our approach sorted by validation Sharpe ratio SR SR SR SMV CSMV HL CHL HU CHU (Train) (Valid) (Test) 1.80 1.01 0.62 4 32 4 0 64 4 1.30 1.01 0.54 4 32 2 1 64 8 2.13 0.97 0.61 4 32 4 0 64 16 2.49 0.96 0.51 4 32 4 0 64 16 Optimal model: 4 moments, 4 macro states, 4 layers, 64 hidden units 18

Results Optimal Portfolio Performance 400 IPCA RtnFcst SDF Cumulated Excess Return 300 200 100 0 1970 1980 1990 2000 2010 Figure: Cumulated Normalized SDF Portfolio. 19

Results Results - Sharpe Ratio for Forecasting Approach Performances with Return Forecast Approach Macro Neurons SR (Train) SR (Valid) SR (Test) Y [32, 16, 8] 0.16 0.24-0.00 Y [128, 128] 1.30 0.10 0.04 N [32, 16, 8] 0.63 0.41 0.27 N [128, 128] 0.67 0.51 0.37 20

Results IPCA: Number of Factors Sharpe Ratio 1.4 1.2 1.0 0.8 0.6 train valid test 0.4 0.2 0 10 20 30 40 K Figure: Sharpe ratio as a function of the number of factors for IPCA 21

Results Results - Sharpe Ratio Performance of Benchmark Models Table: SDF Portfolio vs. Fama-French 5 Factors Mkt-RF SMB HML RMW CMA intercept coefficient 0.06 0.00 0.01 0.17 0.05 0.47 correlation 0.02-0.14 0.25 0.33 0.16 - Conventional factors do no span SDF 22

Results Results - Variable Importance Variables Ranked by Average Absolute Gradient (Top 20) for SDF network ST_REV Lev Beta S2P Investment OP LTurnover r36_13 r12_2 r12_7 AT D2A NOA E2P Variance MktBeta SUV ROE Spread Rel2High 0.00 0.01 0.02 0.03 0.04 0.05 23

Results Results - Variable Importance Variables Ranked by Reduction in R 2 for RtnFcst (Top 20) ST_REV SUV r12_2 FC2Y LTurnover IdioVol Spread A2ME Rel2High CF2P OL MktBeta C PM LME r12_7 E2P S2P ROA OP 0.000 0.001 0.002 0.003 0.004 24

Results Size Effect 0.006 0.004 0.002 weight 0.000 0.002 0.004 0.0 0.2 0.4 0.6 0.8 1.0 LME Figure: SDF weight and market capitalization in test data 25

Non-linearities Results - SDF Weights Relationship between Weights and Characteristics 0.020 0.020 0.015 0.015 0.010 0.010 0.005 weight 0.000 weight 0.005 0.005 0.000 0.010 0.005 0.015 0.010 0.0 0.2 0.4 0.6 0.8 1.0 LME 0.0 0.2 0.4 0.6 0.8 1.0 BEME Figure: Weight as a function of size (LME) and book-to-market (BEME). Size and value have close to linear effect 26

Non-linearities Results - SDF Weights Relationship between Weights and Characteristics 1.0 0.020 0.8 0.016 0.012 BEME 0.6 0.4 0.008 0.004 0.000 weight 0.2 0.004 0.008 0.0 0.0 0.2 0.4 0.6 0.8 1.0 LME 0.012 Figure: Weight as a function of size (LME) and book-to-market (BEME). Size and value have non-linear interaction! 27

Non-linearities Results - SDF Weights Relationship between Weights and Characteristics 0.04343 0.03641 1.0 0.02939 0.8 0.02236 0.2 ST_REV 0.6 0.4 0.01534 0.00832 weight 0.0 0.00130 0.0 0.2 0.4 BEME0.6 0.8 1.0 0.8 0.6 0.4LME 0.2 1.0 0.0 0.00573 0.01275 0.01977 Figure: Weight as a function of size, book-to-market and ST-reversal. Complex interaction between multiple variables! 28

Non-linearities Results - SDF Weights Relationship between Weights and Characteristics 0.02 0.02 0.01 0.01 weight 0.00 weight 0.00 0.01 0.01 0.02 0.02 0.0 0.2 0.4 0.6 0.8 1.0 r36_13 0.0 0.2 0.4 0.6 0.8 1.0 r12_7 Figure: Weight as a function of reversal (r36-13) or momentum (r12-7). Non-linear effect! 29

Non-linearities Results - Weights Relationship between Weights and Characteristics 1.0 0.030 0.8 0.024 0.018 r12_7 0.6 0.4 0.012 0.006 0.000 weight 0.2 0.006 0.012 0.0 0.0 0.2 0.4 0.6 0.8 1.0 r36_13 0.018 Figure: Weight as a function of momentum (r12-7) and reversal (r36-13). Complex interaction! 30

Non-linearities Results - Weights Relationship between Weights and Characteristics 0.03286 0.02704 1.0 0.02123 0.8 0.01541 0.6 LME 0.4 0.2 0.00959 0.00377 weight 0.0 0.00204 0.0 0.2 0.4 r36_13 0.6 0.8 0.2 1.0 0.0 0.4 1.0 0.8 0.6 r12_7 0.00786 0.01368 0.01950 Figure: Weight as a function of momentum (r12-7), reversal (r36-13) and size (LME). Complex interaction between multiple variables! 31

Simulation Simulation Setup Consider a single factor model R i,t+1 = β i,t F t+1 + ε i,t+1 The only factor is sampled from N (µ F, σf 2 ). The loadings are β i,t = C i,t with C i,t i.i.d N (0, 1). The residuals are i.i.d N (0, 1). N = 500 and T = 600. Define training/validation/test = 250, 100, 250. Consider σf 2 {0.01, 0.05, 0.1}. Sharpe Ratio of the factor SR = µ F /σ F = 0.3 or SR = 1. 32

Simulation Simulation Results: Intuition Intuition: Better noise diversification with our approach Simple return prediction SDF estimator 1 N 1 TN N N ( 1 T i=1 i=1 t=1 N (Ri,t+1 e f (I t)) 2 T t=1 ) 2 Ri,t+1M e t+1g(c i,t ) SDF estimator averages out the noise over the time-series 33

Simulation Simulation Results Sharpe Ratio on Test Dataset σ 2 F RtnFcst SDF estimator SR=0.3 0.01 0.03 0.22 0.05 0.20 0.33 0.10 0.35 0.35 SR=1 0.01 0.63 0.96 0.05 0.92 0.97 0.10 1.03 1.03 34

Simulation Simulation Results Estimated loadings and SDF weights (a) Our SDF estimator (b) Return forecasting Our approach detects SDF and loading structure. Simple forecasting approach fails. 35

Conclusion Conclusion Methodology Novel combination of deep-neural networks to estimate the pricing kernel Key innovation: Use no-arbitrage condition as criterion function Time-variation explained by macroeconomic states and firm characteristics General asset pricing model that includes all other models as special cases Empirical Results Outperforms benchmark models Non-linearities and interactions are important 36

Number of Stocks 2500 Train Valid Test Number of Stocks 2000 1500 1000 500 1970 1980 1990 2000 2010 Figure: Number of Stocks A 1

Results Performance of Benchmark Models Table: Max 1 Month Loss & Max Drawdown Max 1 Month Loss Max Drawdown IPCA -6.711 5 RtnFcst (Equally Weighted) -4.005 4 RtnFcst (Value Weighted) -3.997 4 SDF -5.277 4 Optimal portfolio has desirable properties A 2

IPCA: Number of Factors Table: Performance with IPCA Number of Factors SR (Train) SR (Valid) SR (Test) 1 0.113 0.117 0.206 2 0.121 0.100 0.226 3 0.483 0.205 0.184 4 0.498 0.200 0.176 5 0.507 0.196 0.164 6 0.685 0.843 0.485 12 1.049 1.174 0.470 A 3

Results - Sharpe Ratio for Forecasting Approach Performances with Return Forecast Approach Macro Neurons Value Weighted SR (Train) SR (Valid) SR (Test) Y [32, 16, 8] N 0.21 0.09 0.03 Y 0.16 0.24-0.00 Y [128, 128] N 1.51 0.20 0.15 Y 1.30 0.10 0.04 N [32, 16, 8] N 1.13 1.34 0.68 Y 0.63 0.41 0.27 N [128, 128] N 1.22 1.25 0.67 Y 0.67 0.51 0.37 A 4

Optimal Portfolio Performance 400 IPCA RtnFcst SDF Cumulated Excess Return 300 200 100 0 1970 1980 1990 2000 2010 Figure: Cumulated Normalized SDF Portfolio. Use equal weighting for return forecast approach. A 5

Optimal Portfolio Performance 400 IPCA RtnFcst (Equally Weighted) RtnFcst (Value Weighted) SDF Cumulated Excess Return 300 200 100 0 1970 1980 1990 2000 2010 Figure: Cumulated Normalized SDF Portfolio. Include both value weighting and equal weighting for return forecast approach. A 6

Hyper-Parameter Search Search Space CV number of conditional variables: 4, 8, 16, 32 SMV number of macroeconomic state variables: 4, 8, 16, 32 HL number of fully-connected layers: 2, 3, 4 HU number of hidden units in fully-connected layers: 32, 64, 128 D dropout rate (keep probability): 0.9, 0.95 LR learning rate: 0.001, 0.0005, 0.0002, 0.0001 Choose best configuration of all possible combinations (1152) of hyper-parameters on validation set. Use ReLU activation function ReLU(x) i = max(x i, 0). A 7

Models for Comparison Loss Functions for Different Models 1 Simple return prediction 2 Unconditional moment 1 N N (R e i,t+1 f (It ))2 TN i=1 t=1 1 N ( 1 T R e ) 2 i,t+1 N T M t+1 i=1 t=1 3 GAN conditioned on the firm characteristics (benchmark approach) 1 N ( 1 T R e ) 2 i,t+1 N T M t+1g(c i,t ) i=1 t=1 4 GAN network based on moment portfolios ( 1 T ( 1 N R e ) 2 i,t+1 T t=1 N g(c i,t ) )M t+1 i=1 5 Price decile portfolios 1 10 ( 1 T R e ) 2 i,t+1 10 T M t+1 i=1 t=1 A 8

Simulation Results Sharpe Ratio on Test Dataset (SR=1) σ 2 F RtnFcst UNC GAN PortGan Decile 0.01 0.627 0.98 0.964 0.978 0.983 0.05 0.924 0.957 0.969 0.957 0.953 0.1 1.031 1.023 1.033 1.003 1.039 A 9

Simulation Results (Continue) Sharpe Ratio on Test Dataset (SR=0.3) σ 2 F RtnFcst UNC GAN PortGan Decile 0.01 0.03 0.22 0.221 0.222 0.215 0.05 0.199 0.33 0.331 0.319 0.328 0.1 0.353 0.368 0.353 0.366 0.36 A 10

Economic Significance of Variables Sensitivity We define the sensitivity of a particular variable as the magnitude of the derivative of weight w with respect to this variable (averaged over the data): Sensitivity(x j ) = 1 C N w(ĩ t, I i,t ) (1) x j i=1 t with C a normalization constant. The analysis is performed with the feed-forward network and we only consider the sensitivity of firm characteristics and state macro variables. A sensitivity of value z for a given variable means that the weight w will approximately change (in magnitude) by z if that variable is changed by a small amount. A 11

Interactions between Variables Significance of Interactions We might also want to understand how the output simultaneously depends upon multiple variables. We can measure the economic significance of the interaction between variables x i and x j by the derivative: Sensitivity(x i, x j ) = 1 C N 2 w(ĩt, I i,t ) (2) x i x j i=1 This derivative can be generalized to measure higher-order interactions. t A 12

Finite Difference Schemes First-Order and Second-Order Finite Difference Schemes Suppose we have some multivariate function f. Without actually measuring gradients, we can approximate them with finite difference methods f f (x j + ) f (x j ) x j 2 f f (x i +, x j + ) f (x i +, x j ) f (x i, x j + ) + f (x i, x j ) x i x j 2 (4) (3) A 13

Leave-One-Out Methods Leave-One-Out Analysis Leave-one-out analysis is another method to explain the explanatory power of the variables. For each variable, the variable is removed from the model and the Sharpe Ratio is evaluated on the test dataset in the absence of this covariate. Specifically, the leave-one-out variable is set to 0 for all data samples in the test dataset and the Sharpe Ratio is calculated using the reduced variable vector. Then, the variable is replaced in the model, and a leave-one-out test is performed on a new variable. A 14

SDF Network Summary 1 GOAL: Generate portfolio weight w i,t. 2 Input: Macro-economic information history {I 1,..., I t } and firm characteristics I i,t. 3 Output: Weight w i,t. 4 Architecture: The history of macro variables is transformed via a Recurrent Neural Network (RNN). The transformed macro variables extract predictive information and summarize macro history. The transformed macro variables and firm characteristics are passed through a Feed Forward Network to generate weights. A 15

Feed Forward Network Figure: Feed Forward Network with Dropout A 16

Feed Forward Network Network Structure The input layer accepts the raw predictors (or features). h 0 = x i,t = [I i,t, Ĩ t] (5) Each hidden layer takes the output from the previous layer and transforms it into an output as h k = f (h k 1 W k + b k ) k = 1,..., K (6) In our implementation, we use ReLU activation function. ReLU(x) i = max(x i, 0) (7) The output layer is simply a linear transformation of the output from the last hidden layer to a scaler w i,t = h K W K+1 + b K+1 (8) A 17

Feed Forward Network Model Complexity Number of hidden layers: K. Let s denote p k to be the number of neurons (or hidden units) in the layer k. The parameters in the layer k are W k R p k 1 p k and b k R p k (9) with p 0 = dim(i i,t ) + dim(ĩt) and p K+1 = 1. Number of parameters: K+1 k=1 (p k 1 + 1)p k. e.g. A 4-hidden-layer network with hidden units [128, 128, 64, 64] has 39105 parameters. A 18

State RNN Two Reasons for RNN Instead of directly passing macro variables I t as features to the feed forward network, we apply a nonlinear transformation to them with an RNN. Many macro variables themselves are not stationary and have trends. Necessary transformations of I t are essential in generating a statble model. Using RNN allows us to encode all historical information of the macro economy. Intuitively, RNN summarizes all historical macro information into a low dimensional vector of state variables in a data-driven way. A 19

Transform Macro Variables via RNN Properties of RNN For any F t -measurable sequence I t, the output sequence Ĩ t is again F t -measurable. The transformation creates no look-ahead bias. Ĩ t contains all the macro information in the past, while I t only uses current information. RNN helps create a stationary macro inputs for the feed forward network. A 20

Recurrent Network Recurrent Network with RNN Cell Recurrent Network with LSTM Cell A 21

Recurrent Network RNN Cell RNN Cell Structure A vanilla RNN model takes the current input variable x t = I t and the previous hidden state h t 1 and performs a nonlinear transformation to get the current hidden state h t h t = f (h t 1 W h + x t W x ). (10) A 22

Recurrent Network LSTM Cell A 23

Recurrent Network LSTM Cell Structure An LSTM model creates a new memory cell c t with current input x t and previous hidden state h t 1: c t = tanh(h t 1W (c) h + x tw (c) x ). (11) An input gate i t and a forget gate f t are created to control the final memory cell: i t = σ(h t 1W (i) h + x tw x (i) ) (12) f t = σ(h t 1W (f ) h + x tw x (f ) ) (13) c t = f t c t 1 + i t c t. (14) Finally, an output gate o t is used to control the amount of information stored in the hidden state: o t = σ(h t 1W (o) h + x tw x (o) ) (15) h t = o t tanh(c t). (16) A 24

Motivation Our Approach We work with the fundamental pricing equation to obtain estimates of pricing kernel (or Stochastic Discount Factor or SDF). 1 Few additional assumptions. 2 Nonlinear in underlying predictors. 3 Time-varying portfolio weights. 4 Theoretically most profitable portfolio. A 25

Motivation Our Approach We work with the fundamental pricing equation to obtain estimates of pricing kernel (or Stochastic Discount Factor or SDF). 1 Few additional assumptions. APT: E t [M t+1 R e i,t+1] = 0 (17) Projection: M t+1 = 1 + 2 Nonlinear in underlying predictors. 3 Time-varying portfolio weights. 4 Theoretically most profitable portfolio. N w i,t Ri,t+1 e (18) i=1 A 26

Motivation Our Approach We work with the fundamental pricing equation to obtain estimates of pricing kernel (or Stochastic Discount Factor or SDF). 1 Few additional assumptions. 2 Nonlinear in underlying predictors. We model portfolio weights w i,t as some general function of macro-economic information I t and firm-specific characteristics I i,t : w i,t = w(i t, I i,t ; θ), (19) which can be highly nonlinear in input variables and high dimensional parameter θ. (Ans: Neural Networks) 3 Time-varying portfolio weights. 4 Theoretically most profitable portfolio. A 27

Motivation Our Approach We work with the fundamental pricing equation to obtain estimates of pricing kernel (or Stochastic Discount Factor or SDF). 1 Few additional assumptions. 2 Nonlinear in underlying predictors. 3 Time-varying portfolio weights. We construct infinite number of moment conditions from pricing formula (17). For any F t -measurable variable Ît, 4 Theoretically most profitable portfolio. E[M t+1 R e i,t+1ît] = 0. (20) A 28

Motivation Our Approach We work with the fundamental pricing equation to obtain estimates of pricing kernel (or Stochastic Discount Factor or SDF). 1 Few additional assumptions. 2 Nonlinear in underlying predictors. 3 Time-varying portfolio weights. 4 Theoretically most profitable portfolio. With (17) and (18), w i,t defines a portfolio with the highest Sharpe Ratio. A 29

Comparison with Gu et al. (2018) Target - Difference Gu et al. (2018): Given current available information, what is the best guess of asset s future return E[r i,t+1 F t ]? [Chen et al., 2018]: Given current available information, what is the best guess of SDF (projected on asset span) that prices all the assets? Target - Connection The (conditional) expectation and Sharpe Ratio of SDF is related to the estimation of E[r i,t+1 F t ] and E[r i,t+1 r j,t+1 F t ]. E[SDF t+1 F t ] = 1 + w t E[R e t+1 F t ] (21) E[SDF 2 t+1 F t ] = 1 + 2w t E[R e t+1 F t ] + w t E[R e t+1r e t+1 F t ]w t (22) A 30

Comparison with Gu et al. (2018) Objective Function (Loss Function) - Difference Gu et al. (2018): For any F t-measurable variable g(z i,t ; θ), E[r i,t+1 F t] is the one such that E[(r i,t+1 g(z i,t ; θ)) 2 ] is minimized. The empirical loss function reads as 1 NT N i=1 t=1 T (r i,t+1 g(z i,t ; θ)) 2 (23) [Chen et al., 2018]: SDF t+1 is a process such that for any asset and any conditional variable Ît, E[SDFt+1Re i,t+1ît] = 0. There are infinite number of moment conditions and unconditional expectation E[SDF t+1ri,t+1] e = 0 is only one of them. Therefore, the empirical loss function based on unconditional expectation might not be enough. 1 N N ( 1 T i=1 T 2 SDF t+1ri,t+1) e (24) t=1 A 31

Comparison with Gu et al. (2018) Model Architecture - Difference Gu et al. (2018): Concatenate macro variables and firm characteristics as inputs of a fully-connected network to model E[r i,t+1 F t ]. [Chen et al., 2018]: Encode macro variables to state macro variables with an RNN, which are then concatenated with firm characteristics as inputs of a fully-connected network to model w t. A 32

Comparison with Gu et al. (2018) Optimal Portfolio - Difference Gu et al. (2018): The stocks are sorted into deciles based on model s forecasts. A zero-net-investment portfolio is constructed that buys the highest expected return stocks (decile 10) and sells the lowest (decile 1) with equal weights. [Chen et al., 2018]: The portfolio weights are given by the model. The optimal portfolio wt Rt+1 e is obtained by shorting SDF portfolio. A 33

Model Architecture Activation Function The function f is nonlinear and is called the activation function. Common activation functions are Sigmoid, tanh and ReLU. σ(x) = 1 1 + e x tanh(x) = 2σ(2x) 1 ReLU(x) = max(0, x) (25) A 34

Gu, S., Kelly, B. T., and Xiu, D. (2018). Empirical asset pricing via machine learning. A 35