Expected Returns Estimate

Estimate the annualized expected return of every asset with every estimator the optimizers take, side by side.

It shows how much the choice moves the input that mean-variance weights are most sensitive to.

  • Mean: the historical average return per period times P, the number of periods in a year.
  • Geometric: the compounded average, \((\Pi (1 + r_{t}))^{P / T} - 1\) over the T periods.
  • Exponential: the exponentially weighted average with \(\alpha = 2\) / (span + 1), times P.
  • Exponential Geometric: that average compounded, (1 + m)^P - 1.
  • CAPM: \(r_{f} + \beta_{i} (E [r_{m}] - r_{f})\) with the benchmark as the market (Sharpe, 1964).
  • Bayes-Stein: the averages shrunk towards the average return of the minimum variance portfolio, \(\mu = (1 - \phi) \hat{\mu} + \phi \mu_{0} 1\) with \(\phi = (N + 2) / ((N + 2) + T (\hat{\mu} - \mu_{0} 1)' \Sigma^{- 1} (\hat{\mu} - \mu_{0} 1))\) and \(\Sigma = S (T - 1) / (T - N - 2)\) (Jorion, 1986).
  • James-Stein: the averages shrunk towards their grand mean \(\bar{\mu}\), \(\mu = (1 - \beta) \hat{\mu} + \beta \bar{\mu} 1\) with \(\beta = (\sum \lambda_{k} - 2 \max \lambda_{k}) / (T \text{‖} \hat{\mu} - \bar{\mu} 1 \text{‖}^{2})\) clipped to [0, 1] and \(\lambda_{k}\) the eigenvalues of the sample covariance.
  • Bodnar-Okhrin-Parolya: \(\mu = \alpha \hat{\mu} + \beta b\) with the grand mean as the target b and the weights \(\alpha\) and \(\beta\) of Bodnar, Okhrin and Parolya (2019).
  • Centroid: the returns that only an ordering of the assets implies (Almgren and Chriss, 2006), \(\mu_{i} = c_{i} \sigma_{i}\) with \(\sigma_{i}\) the annualized volatility and \(c_{i}\) the expected value of the i-th largest of N standard normal draws, approximated by \(c_{j} = \Phi^{- 1} ((N + 1 - j - \alpha) / (N - 2 \alpha + 1))\) with \(\alpha = 0.4424 - 0.1185 N^{- 0.21}\); assets ranked together share the average c of their positions. It takes the ranking, from the highest expected return to the lowest, from anywhere: a view, or the scores of any metric of the Toolkit.

Also known as: shrunk mu, shrinkage expected returns, CAGR, geometric mean return, centroid returns, ranking returns, returns from an ordering.

Example · AAPL, MSFT, JNJ, XOM · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_expected_returns_estimate:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "JNJ", "XOM"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.portfolio.get_expected_returns_estimate(
    show_columns=["Mean", "Geometric", "Bayes-Stein", "James-Stein", "Bodnar-Okhrin-Parolya"]
)

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

What expected returns do the mean, geometric, Bayes-Stein, James-Stein and Bodnar-Okhrin-Parolya estimators give Apple, Microsoft, Johnson & Johnson and ExxonMobil, based on 2021 to 2025?

Which returns:

Parameters

get_expected_returns_estimate accepts the following parameters.

ParameterTypeDescriptionExample
methodstr | list[str] | NoneThe estimators. Options are: “mean” (the historical average), “geometric” (the compounded average), “exponential” (the exponentially weighted average, recent periods weigh most), “exponential_geometric” (that average compounded over a year), “capm” (the returns the Capital Asset Pricing Model implies from each asset’s beta to the benchmark, Sharpe, 1964), “bayes_stein” (the averages shrunk towards that of the minimum variance portfolio, Jorion, 1986), “james_stein” (the averages shrunk towards their grand mean, James and Stein, 1961), “bodnar_okhrin_parolya” (the averages and their grand mean combined with optimal weights, Bodnar, Okhrin and Parolya, 2019), “centroid” (the returns an ordering of the assets implies, Almgren and Chriss, 2006). Defaults to None, all of them (CAPM only when there is a benchmark, Centroid only with a ranking).None, all of them (CAPM only when there is a benchmark, Centroid only with a ranking)
periodstrThe frequency of the returns. Options are: “daily” (daily returns), “weekly” (weekly returns), “monthly” (monthly returns), “quarterly” (quarterly returns), “yearly” (yearly returns). Defaults to “daily”."weekly"
spanintThe span in periods of the exponential averages. Defaults to 180.180
adjustboolWhether the exponential averages normalize the weights over the whole history rather than follow the recursion \(m_{t} = \alpha r_{t} + (1 - \alpha) m_{t - 1}\). Defaults to True.True
rankinglist | dict | pd.Series | NoneThe ordering of the centroid estimator, from the highest expected return to the lowest: a list of every asset ([“MSFT”, “AAPL”, …]), whose entries can be lists of assets ranked together ([“MSFT”, [“AAPL”, “JNJ”], “XOM”]), or a score per asset ({“AAPL”: 2.1, …} or a pd.Series, higher is better, equal scores ranked together). Defaults to None.None
include_benchmarkboolWhether to include the benchmark as an asset. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding.2
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper James, W. and Stein, C. (1961). “Estimation with Quadratic Loss.” Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, 1, 361-379.
  • Paper Jorion, P. (1986). “Bayes-Stein Estimation for Portfolio Analysis.” Journal of Financial and Quantitative Analysis, 21(3), 279-292.
  • Paper Bodnar, T., Okhrin, O. and Parolya, N. (2019). “Optimal Shrinkage Estimator for High-Dimensional Mean Vector.” Journal of Multivariate Analysis, 170, 63-79.
  • Paper Almgren, R. and Chriss, N. (2006). “Optimal Portfolios from Ordering Information.” Journal of Risk, 9(1), 1-47.
  • Library Referenced against PyPortfolioOpt’s mean_historical_return (geometric average)
  • Library Referenced against PyPortfolioOpt’s ema_historical_return (exponentially weighted averages)
  • Library Referenced against PyPortfolioOpt’s capm_return (CAPM return)
  • Library Referenced against Riskfolio-Lib’s mean_vector (the exponential recursion)
  • Library Referenced against skfolio’s ShrunkMu (James-Stein)
  • Library Referenced against skfolio’s ShrunkMu (Bodnar-Okhrin)
  • Library Shares similar logic as skfolio’s ShrunkMu (Bayes-Stein)
  • Library Shares similar logic as Riskfolio-Lib’s mean_vector (James-Stein)
  • Library Shares similar logic as Riskfolio-Lib’s mean_vector (Bodnar-Okhrin-Parolya)
  • Library Shares similar logic as PortfolioAnalytics (R)’s ac.ranking (centroid)
  • Library Shares similar logic as PortfolioAnalytics (R)’s centroid.complete.mc (centroid)
Share