skfolio.measures.drawdown_at_risk#
- skfolio.measures.drawdown_at_risk(drawdowns, beta=0.95, sample_weight=None)[source]#
Compute the Drawdown at risk.
The Drawdown at risk (DaR) is the smallest drawdown exceeded with probability at most \(1 - \beta\). It is the value at risk of the drawdowns, see
value_at_risk.- 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.
- betafloat, default = 0.95
The DaR confidence level, between 0 and 1, inclusive.
- 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,)
Drawdown at risk. If
drawdownsis a 1D-array, the result is a float. Ifdrawdownsis a 2D-array, the result is a ndarray of shape (n_assets,).