skfolio.measures.average_drawdown#
- skfolio.measures.average_drawdown(drawdowns, sample_weight=None)[source]#
Compute the average drawdown.
- Parameters:
- drawdownsndarray of shape (n_observations,) or (n_observations, n_assets)
Nonpositive drawdowns computed from the full return path, including dates with zero sample weight.
- sample_weightndarray of shape (n_observations,), optional
Relative observation weights. Must be finite and nonnegative. If None, equal weights are assumed. NaN drawdowns and their weights are excluded, and the remaining weights are rescaled to sum to one. The result is NaN if no observations or no positive weight remain.
- Returns:
- valuefloat or ndarray of shape (n_assets,)
Average drawdown. If
drawdownsis a 1D-array, the result is a float. Ifdrawdownsis a 2D-array, the result is a ndarray of shape (n_assets,).