Geometric Mean

The Geometric Mean is the compounded average return over the history: the constant yearly return that turns the first value into the last, also called the compound annual growth rate (CAGR).

The formula for the Geometric Mean is as follows:

\[\mu_{i} = \prod_{t=1}^{T} (1 + r_{i,t})^{P/T} - 1\]

Where \(r_{i , t}\) is the return of asset i in period t of the T periods and P the number of periods in a year. It lies below the arithmetic average by about half the variance of the returns, so volatile assets look less attractive than with the Historical Mean; it describes the growth of wealth that was achieved rather than the expected return of a single period.

It shows how much the choice moves the input that mean-variance weights are most sensitive to. The expected return of an asset can only be estimated from a short and noisy history: the precision of an average return grows with the length of the history in years, not with the number of periods within them, so even decades of data leave it imprecise. An optimizer that takes such estimates at face value bets most on the assets whose averages happen to be highest in the sample. The estimators differ in how they deal with this: by weighting recent periods, by deriving the returns from a model of risk, by shrinking the averages towards a common value or by using only an ordering of the assets.

Also known as: CAGR, compound annual growth rate, geometric mean return.

In the Finance Toolkit this is get_expected_returns_estimate with method="geometric", the same function as Expected Returns Estimate.

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(method="geometric", show_columns=["Mean", "Geometric", "Bayes-Stein", "James-Stein", "Bodnar-Okhrin-Parolya"])

Which returns:

References

  • Library Referenced against PyPortfolioOpt’s mean_historical_return (Geometric Mean)
  • Library Referenced against PyPortfolioOpt’s ema_historical_return (Exponentially Weighted Mean, Exponentially Weighted Geometric Mean)
Share