skfolio.measures
.mean_absolute_deviation#
- skfolio.measures.mean_absolute_deviation(returns, min_acceptable_return=None, sample_weight=None)[source]#
Compute the mean absolute deviation (MAD).
- Parameters:
- returnsndarray of shape (n_observations,) or (n_observations, n_assets)
Array of return values.
- min_acceptable_returnfloat or ndarray of shape (n_assets,) optional
Minimum acceptable return. It is the return target to distinguish “downside” and “upside” returns. The default (
None
) is to use the returns’ mean.- sample_weightndarray of shape (n_observations,), optional
Sample weights for each observation. If None, equal weights are assumed.
- Returns:
- valuefloat or ndarray of shape (n_assets,)
Mean absolute deviation. If
returns
is a 1D-array, the result is a float. Ifreturns
is a 2D-array, the result is a ndarray of shape (n_assets,).