<a id="skfolio-measures-gini-mean-difference"></a>

# skfolio.measures.gini_mean_difference

<a id="skfolio.measures.gini_mean_difference"></a>

### skfolio.measures.gini_mean_difference(returns)

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:**
  **returns** *ndarray of shape (n_observations,) or (n_observations, n_assets)*
  : Array of return values.
* **Returns:**
  **value** *float 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,).

