cdar

Defined in fynance.metrics

cdar(X, alpha=0.05)[source]

Conditional Drawdown-at-Risk of a price/equity curve.

Mean of the alpha worst drawdown depths [3] observed over the series — the drawdown analogue of cvar: while mdd reports only the single worst drawdown, CDaR averages the whole worst tail, making it less sensitive to a single outlier path.

Parameters:
Xarray_like

Time-series of price, performance or index (a single curve). Must be positive values (see drawdown).

alphafloat, optional

Tail fraction, in (0, 1). Default is 0.05.

Returns:
float

Conditional Drawdown-at-Risk, in [0, 1]. Always \(\geq\) mdd divided by 1 (it is a tail mean, so \(\leq\) the maximum drawdown).

See also

cvar, var, mdd, drawdown

Notes

Let \(DD\) be the percentage drawdown path of X (see drawdown) and \(T\) its length:

\[CDaR_\alpha = \frac{1}{k}\sum_{i=1}^{k} DD_{(T + 1 - i)}\]

where \(DD_{(1)} \leq \dots \leq DD_{(T)}\) is \(DD\) sorted ascending and \(k = \max(1, \lfloor \alpha T \rfloor)\) (_tail_k) — the same tail-count convention as var/cvar.

References

[3]

Chekhlov, A., Uryasev, S., and Zabarankin, M., 2005, Drawdown Measure in Portfolio Optimization, International Journal of Theoretical and Applied Finance, 8(1), 13-58.

Examples

>>> import numpy as np
>>> X = np.array([100., 90., 95., 80., 110., 70., 120., 60., 130.])
>>> round(cdar(X, alpha=0.3), 4)
0.4318