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.
This is the shared aggregation kernel behind AverageDrawdown and RelativeAverageDrawdown: the two measures differ only in the drawdown series they feed it (absolute_drawdown_vec and relative_drawdown_vec respectively), so the averaging lives here once.
Dispatch on the second argument selects the weighting scheme, so callers resolve observation weights with get_observation_weights and let dispatch do the rest. Resolving before dispatching is what makes a DynamicAbstractWeights work here — the aggregator only ever sees a concrete weight vector or nothing.
::Nothing: unweighted arithmetic mean.w::VecNum: weighted mean.
Arguments
dd::VecNum: Drawdown series, all entries ≤ 0. Not modified.w: Resolved observation weights, ornothingfor the unweighted mean.
Returns
Number: Average drawdown, returned as a positive loss.
Related