Skip to main content

Predicting Stock Returns

Published

November 23, 2026

Can a model predict the stock market? A forecast of next month’s return that is even slightly better than a guess would let an investor hold more stocks when expected returns are high and fewer when they are low, and few questions in finance have been studied as much. This chapter explains why the question is hard, how forecasts are judged, what decades of research have found with simple models, and what machine learning adds. The neural networks of the previous chapters succeeded because the relation they learned was strong and stable; here it is weak and changes over time, and that difference decides almost everything.

A small signal in a lot of noise

The equity premium is the return on stocks above the return on Treasury bills. From 1926 to 2025, the monthly premium on the S&P 500 averaged 0.70% with a standard deviation of 5.38%, as Figure 1 shows. A typical month’s premium is about eight times as far from the average as the average is from zero.

Monthly equity premium from 1926 to 2025 as thin vertical lines swinging between about minus 30 and plus 40 percent in the 1930s and mostly between minus 10 and plus 10 percent afterward. The running average of all earlier months moves slowly between about 0.4 and 1 percent after 1940, barely visible against the swings.
Figure 1: Monthly equity premium of the S&P 500, the return on the value-weighted CRSP index of S&P 500 stocks minus the Treasury bill rate, and its average over all earlier months. Source: Amit Goyal’s update of Welch and Goyal (2008).

A model that predicts the premium must find a small, slowly moving expected return inside this noise. Even if it knew the expected return exactly, most of each month’s premium would remain unpredictable, because that is what makes stocks risky. In a market where many investors look for the same signal, any easy predictability would be traded away. A forecast that explains one percent of the monthly variation can therefore be a good one, and the question is how to tell a real one percent from luck.

Judging a forecast out of sample

A regression of the premium on a predictor, fitted on all the data, always explains some of the variation, even if the predictor is useless: the fit picks up the noise that happens to line up with it. The test that matters is whether a forecast made with data available at the time beats the simplest alternative, the historical average of the premium up to that time. The out-of-sample R^2 compares the squared errors of the two: R^2_{\text{OOS}} = 1 - \frac{\sum_{t} (y_t - \hat{y}_t)^2}{\sum_{t} (y_t - \bar{y}_t)^2}, \tag{1} where y_t is the premium in month t, \hat{y}_t the model’s forecast and \bar{y}_t the historical average, both computed only from data available before t. In practice the model is re-estimated as time passes, for example every year on all the data up to then. Unlike the R^2 of a regression, the out-of-sample R^2 is negative when the model does worse than the average, which happens often.

The evidence with simple models

Welch and Goyal (2008) collect the variables that earlier research had proposed as predictors of the market’s return, such as the dividend-price ratio, interest rates, the default spread and stock market variance, and find that out of sample these regressions do not beat the historical average. A model can look good in the sample it was estimated on and lose to the average on new data. Goyal et al. (2024) repeat the exercise through 2021 with 29 variables from 26 papers published after 2008. More than a third of these variables are no longer significant even in sample, and half of the rest predict poorly out of sample.

Goyal, Amit, Ivo Welch, and Athanasse Zafirov. 2024. “A Comprehensive 2022 Look at the Empirical Performance of Equity Premium Prediction.” The Review of Financial Studies 37 (11): 3490–557. https://doi.org/10.1093/rfs/hhae044.

Campbell and Thompson (2008) answer that many of the regressions beat the historical average once weak restrictions are imposed, for example that a forecast of the premium should never be negative, and that the small out-of-sample R^2 that results “is economically meaningful for mean-variance investors.” The right comparison, they argue, is with the squared Sharpe ratio S^2 of the market. An investor who adjusts the share in stocks with the forecast raises the expected return of the portfolio by roughly R^2/S^2 in proportion, when both are small. With monthly data since 1871, the Sharpe ratio is 0.108 per month, so S^2 is about 1.2%, and the out-of-sample R^2 of 0.43% they find for the smoothed earnings-price ratio raises the portfolio’s average return by about 0.43/1.2 = 36\%: for an investor with a risk aversion of three, about 1.7% a year.

What machine learning adds

A neural network can combine predictors in ways a regression cannot, but the problem of the previous section does not go away: the signal is small, the data are short, and a century of monthly data is about 1,200 observations. The notebook Predicting Returns with a Neural Network forecasts the premium from 2000 to 2025 with nine predictors of Welch and Goyal (2008), re-estimating every year. The regression with all nine has an out-of-sample R^2 of -11.7\%, and a network with one hidden layer, averaged over five starting points, -53.9\%. Most of the network’s loss comes from two episodes, late 2008 and March 2020, when stock market variance reached about 10 and 12 standard deviations above anything in the estimation sample: the network extrapolated far outside its data and forecast large losses just as the market recovered.

Welch, Ivo, and Amit Goyal. 2008. “A Comprehensive Look at the Empirical Performance of Equity Premium Prediction.” Review of Financial Studies 21 (4): 1455–508.
Gu, Shihao, Bryan Kelly, and Dacheng Xiu. 2020. “Empirical Asset Pricing via Machine Learning.” Review of Financial Studies 33 (5): 2223–73. https://doi.org/10.1093/rfs/hhaa009.

With far more data, machine learning helps. Gu et al. (2020) forecast the returns of tens of thousands of individual stocks from many characteristics. Forecasting the S&P 500 from forecasts of its individual stocks, a linear model has a monthly out-of-sample R^2 of -0.22\%, while trees and neural networks reach between 1.08\% and 1.80\%. They also find that network performance “peaks at three hidden layers then declines as more layers are added,” which they attribute to “the relatively small amount of data and tiny signal-to-noise ratio” of return prediction. In finance, a small model that predicts a little out of sample beats a large one that fits the past perfectly.

How complex should a model be?

Size alone may not be the problem, though, and this is an active debate. Kelly et al. (2024) prove that, with enough shrinkage of the weights, a model with far more parameters than observations can predict returns better than a small one. Their model is a very wide network with one hidden layer whose weights are drawn at random and never trained, with only the output weights estimated. Applied to the Welch and Goyal predictors on rolling 12-month windows, it has a small out-of-sample R^2, but timing the market with its forecasts earns a Sharpe ratio above 0.4. Nagel (2025) argues that a model with thousands of parameters and 12 observations ends up forecasting with a weighted average of the last 12 returns, so the strategy is in effect momentum that happened to do well historically, not a signal learned from the predictors. Kelly and Malamud (2025) reply that the critique leaves their results intact.

Kelly, Bryan, Semyon Malamud, and Kangying Zhou. 2024. “The Virtue of Complexity in Return Prediction.” The Journal of Finance 79 (1): 459–503.
Nagel, Stefan. 2025. Seemingly Virtuous Complexity in Return Prediction. Working Paper No. 34104. National Bureau of Economic Research.
Kelly, Bryan, and Semyon Malamud. 2025. Understanding the Virtue of Complexity. Working Paper No. 5346842. SSRN.

Practice Problems

These problems give you a chance to practice the concepts introduced in this chapter. Try to solve each one on your own before expanding the solution.

Problem 1 (A Model That Fits Well and Predicts Badly) You train a neural network to predict monthly market returns from ten predictors. On the training sample of 1950 to 2000 its R^2 is 35%. On 2001 to 2025, its out-of-sample R^2 relative to the historical average, as in (1), is -4\%. Select all statements that apply.

  1. On 2001 to 2025, the network’s squared forecast errors are larger than those of the historical average return.
  2. The high training R^2 shows the network has found a strong relation that will appear in future data.
  3. The gap between the two numbers is a sign of overfitting.
  4. A negative out-of-sample R^2 is impossible, so the calculation must be wrong.
Solution The answers are (a) and (c). By (1), a negative out-of-sample R^2 means the model’s sum of squared errors exceeds that of the historical average, so (a) holds and (d) is wrong: unlike the in-sample R^2 of a regression with an intercept, the out-of-sample version has no lower bound of zero. A flexible model that explains 35% of returns in sample and loses to the average out of sample has fit noise in the training data, which is overfitting, so (c) holds and (b) does not.

Problem 2 (Is a Small R^2 Worth Anything?) The monthly Sharpe ratio of the stock market is about 0.11. A forecasting model has a monthly out-of-sample R^2 of 0.5%. Using the approximation of Campbell and Thompson (2008), by what proportion can a mean-variance investor who times the market with the model raise the expected return of the portfolio? Why is it misleading to call an R^2 of 0.5% useless?

Campbell, John Y., and Samuel B. Thompson. 2008. “Predicting Excess Stock Returns Out of Sample: Can Anything Beat the Historical Average?” The Review of Financial Studies 21 (4): 1509–31.
Solution The squared Sharpe ratio is 0.11^2 = 0.0121, so the proportional increase in expected return is roughly R^2/S^2 = 0.005/0.0121 \approx 41\%. An R^2 of 0.5% sounds tiny because most of a month’s return is noise, but the investor does not need to predict the noise. What matters is how the predictable part compares with the reward the market pays for bearing its risk, measured by the squared Sharpe ratio, and that is also small. The catch is that the 0.5% must be real: an in-sample R^2 of that size is easily produced by luck, which is why only out-of-sample results count.

Problem 3 (Splitting by Time) A student tests a model of monthly market returns by picking 20% of the months from 1950 to 2025 at random as a test sample and training on the rest. The model’s R^2 on the test months is 6%. Why is this not a fair test of whether the model could have been used to time the market?

Solution A random split lets the model learn from months that come after the months it is tested on. Predictors such as valuation ratios move slowly, so neighboring months look alike, and a model trained on 1975 and 1977 has effectively seen 1976. An investor in 1976 could not have used data from 1977, so the test overstates what the model could have done. A fair test trains only on data available before each forecast and re-estimates as time passes, as in (1).