Mean-Gini Mean Difference Optimization

The Gini Mean Difference is the average absolute difference between the portfolio returns of two periods (Yitzhaki, 1982). Shalit and Yitzhaki (1984) built a mean-Gini portfolio theory on it, which ranks portfolios consistently with expected utility for a wider set of return distributions than the variance does.

The formula for the Gini Mean Difference starts from the return \(X_{t}\) of the portfolio in each of the T periods, with \(w_{i}\) the weight and \(r_{i , t}\) the return of asset i of the N assets:

\[X_{t} = \sum_{i=1}^{N} w_{i} \cdot r_{i,t}\] \[\text{GMD} = \frac{\sum_{s=1}^{T} \sum_{t=1}^{T} \left\lvert X_{s} - X_{t}\right\rvert}{T \cdot (T - 1)}\]

It measures dispersion like the volatility, but with absolute rather than squared differences, so it is less sensitive to a few extreme periods; gains and losses count alike.

It is the portfolio with the lowest risk, the lowest risk at a target return, or the highest ratio of the average excess return to the risk. Mean-variance analysis measures risk by the variance; the mean-risk portfolios keep its trade-off between expected return and risk and measure the risk of the historical portfolio returns in another way. Measures that only count losses leave upside swings unpenalized, the dispersion measures count deviations in proportion to their size rather than their square, and the drawdown measures penalize deep and long falls, which are what investors feel and what ends strategies.

There are two objectives. The minimum risk portfolio minimizes the risk measure, at a target expected return when one is given. The maximum ratio portfolio maximizes the expected excess return over the risk measure, with the transformation of Charnes and Cooper (1962) that turns the ratio into a problem of the same kind as the minimum risk one; with the volatility as the measure, it would be the maximum Sharpe ratio portfolio.

Also known as: GMD, mean-Gini, Gini-optimal portfolio.

In the Finance Toolkit this is get_mean_risk_weights with risk_measure="gini_mean_difference", the same function as Mean-Risk Weights.

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

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

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_mean_risk_weights(
    risk_measure="gini_mean_difference", objective="maximum_ratio"
)[["Weight", "Expected Return", "Gini Mean Difference", "Gini Mean Difference Ratio"]]

Which returns:

References

  • Paper Charnes, A. and Cooper, W. W. (1962). “Programming with Linear Fractional Functionals.” Naval Research Logistics Quarterly, 9(3-4), 181-186.
  • Paper Yitzhaki, S. (1982). “Stochastic Dominance, Mean Variance, and Gini’s Mean Difference.” The American Economic Review, 72(1), 178-185.
  • Paper Shalit, H. and Yitzhaki, S. (1984). “Mean-Gini, Portfolio Theory, and the Pricing of Risky Assets.” The Journal of Finance, 39(5), 1449-1468.
  • Paper Kelley, J. E. (1960). “The Cutting-Plane Method for Solving Convex Programs.” Journal of the Society for Industrial and Applied Mathematics, 8(4), 703-712.
  • Paper Ben-Ameur, W. and Neto, J. (2007). “Acceleration of Cutting-Plane and Column Generation Algorithms: Applications to Network Design.” Networks, 49(1), 3-17.
Share