skfolio.measures.gini_mean_difference#

skfolio.measures.gini_mean_difference(returns)[source]#

Compute the Gini mean difference (GMD).

The GMD is the expected absolute difference between two realisations. The GMD is a superior measure of variability for non-normal distribution than the variance. It can be used to form necessary conditions for second-degree stochastic dominance, while the variance cannot.

Parameters:
returnsndarray of shape (n_observations,) or (n_observations, n_assets)

Array of return values.

Returns:
valuefloat or ndarray of shape (n_assets,)

Gini mean difference. If returns is a 1D-array, the result is a float. If returns is a 2D-array, the result is a ndarray of shape (n_assets,).