Average Drawdown
PortfolioOptimisers.AverageDrawdown Type
struct AverageDrawdown{__T_settings, __T_w} <: RiskMeasureRepresents the Average Drawdown risk measure.
AverageDrawdown computes the mean of the absolute drawdown series of the portfolio returns. It provides a measure of the average magnitude of drawdowns over the sample period.
Mathematical definition
Define the absolute drawdown series:
Where:
: Portfolio returns vector . : Cumulative simple portfolio return at period . : Absolute drawdown at period .
The Average Drawdown is:
Where:
: Average drawdown. : Number of observations. : Absolute drawdown at period .
For observation-weighted samples, the weighted mean is used instead.
Fields
settings: Risk measure settings.w: Optional portfolio weights.
Constructors
AverageDrawdown(;
settings::RiskMeasureSettings = RiskMeasureSettings(),
w::Option{<:ObsWeights} = nothing
) -> AverageDrawdownKeywords correspond to the struct's fields.
Validation
- If
wis notnothing:!isempty(w).
Functor
(r::AverageDrawdown)(x::VecNum)Computes the Average Drawdown of a portfolio returns vector x.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> AverageDrawdown()
AverageDrawdown
settings ┼ RiskMeasureSettings
│ scale ┼ Float64: 1.0
│ ub ┼ nothing
│ rke ┴ Bool: true
w ┴ nothingRelated
PortfolioOptimisers.RelativeAverageDrawdown Type
struct RelativeAverageDrawdown{__T_settings, __T_w} <: HierarchicalRiskMeasureRepresents the Relative Average Drawdown risk measure for hierarchical optimisation.
RelativeAverageDrawdown computes the mean of the relative (compounded) drawdown series of the portfolio returns.
Mathematical definition
Define the compounded wealth process and relative drawdown series:
Where:
: Portfolio returns vector . : Compound wealth process at period . : Relative drawdown at period .
The Relative Average Drawdown is:
Where:
: Relative average drawdown. : Number of observations. : Relative drawdown at period .
Fields
settings: Risk measure settings.w: Optional portfolio weights.
Constructors
RelativeAverageDrawdown(;
settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(),
w::Option{<:ObsWeights} = nothing
) -> RelativeAverageDrawdownKeywords correspond to the struct's fields.
Validation
- If
wis notnothing:!isempty(w).
Functor
(r::RelativeAverageDrawdown)(x::VecNum)Computes the Relative Average Drawdown of a portfolio returns vector x.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> RelativeAverageDrawdown()
RelativeAverageDrawdown
settings ┼ HierarchicalRiskMeasureSettings
│ scale ┴ Float64: 1.0
w ┴ nothingRelated
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
source