Average Drawdown: private API
PortfolioOptimisers.average_drawdown — Function
average_drawdown(dd::VecNum, ::Nothing) -> Number
average_drawdown(dd::VecNum, w::VecNum) -> NumberAggregate a drawdown series into its mean drawdown, returned as a nonnegative loss.
AverageDrawdown and RelativeAverageDrawdown both call this kernel. They differ only in the series that they give it: absolute_drawdown_vec for the first, and relative_drawdown_vec for the second. ulcer_index is the kernel of the root-mean-square drawdown.
The type of the second argument selects the method. Callers resolve the observation weights with checked_observation_weights first, so the kernel sees a weight vector or nothing, and never a DynamicAbstractWeights. The weighted method takes any weight vector, a plain one too.
Mathematical definition
\[\begin{align} \mathrm{ADD}(\boldsymbol{\delta}) &= -\frac{1}{T} \sum_{t=1}^{T} \delta_t\,, \\ \mathrm{ADD}_{w}(\boldsymbol{\delta}) &= -\frac{1}{W_{T}} \sum_{t=1}^{T} w_{t} \delta_t\,. \end{align}\]
Where:
- $\boldsymbol{\delta}$: Drawdown series
dd$T \times 1$, absolute or relative, every entry $\leq 0$. - $\mathrm{ADD}(\boldsymbol{\delta})$, $\mathrm{ADD}_{w}(\boldsymbol{\delta})$: The mean drawdown of the methods without and with weights.
- $w_{t}$: Observation weight of observation $t$.
- $W_{T} = \sum_{t=1}^{T} w_{t}$: Total observation weight.
- $T$: Number of observations.
Arguments
dd::VecNum: Drawdown series, every entry $\leq 0$. The function does not write it.w: Resolved observation weights, ornothingfor the mean without weights.
Returns
Number: Mean drawdown, returned as a nonnegative loss.
Related