Skip to content
18

Average Drawdown

PortfolioOptimisers.AverageDrawdown Type
julia
struct AverageDrawdown{__T_settings, __T_w} <: RiskMeasure

Represents 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:

ct=s=1txs,dt=ctmax0stcs0.

Where:

  • x: Portfolio returns vector T×1.

  • ct: Cumulative simple portfolio return at period t.

  • dt0: Absolute drawdown at period t.

The Average Drawdown is:

ADD(x)=1Tt=1Tdt.

Where:

  • ADD(x): Average drawdown.

  • T: Number of observations.

  • dt0: Absolute drawdown at period t.

For observation-weighted samples, the weighted mean is used instead.

Fields

  • settings: Risk measure settings.

  • w: Optional portfolio weights.

Constructors

julia
AverageDrawdown(;
    settings::RiskMeasureSettings = RiskMeasureSettings(),
    w::Option{<:ObsWeights} = nothing
) -> AverageDrawdown

Keywords correspond to the struct's fields.

Validation

  • If w is not nothing: !isempty(w).

Functor

julia
(r::AverageDrawdown)(x::VecNum)

Computes the Average Drawdown of a portfolio returns vector x.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia
julia> AverageDrawdown()
AverageDrawdown
  settings ┼ RiskMeasureSettings
           │   scale ┼ Float64: 1.0
           │      ub ┼ nothing
           │     rke ┴ Bool: true
         w ┴ nothing

Related

source
PortfolioOptimisers.RelativeAverageDrawdown Type
julia
struct RelativeAverageDrawdown{__T_settings, __T_w} <: HierarchicalRiskMeasure

Represents 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:

Ct=s=1t(1+xs),rdt=Ctmax0stCs10.

Where:

  • x: Portfolio returns vector T×1.

  • Ct: Compound wealth process at period t.

  • rdt0: Relative drawdown at period t.

The Relative Average Drawdown is:

RADD(x)=1Tt=1Trdt.

Where:

  • RADD(x): Relative average drawdown.

  • T: Number of observations.

  • rdt0: Relative drawdown at period t.

Fields

  • settings: Risk measure settings.

  • w: Optional portfolio weights.

Constructors

julia
RelativeAverageDrawdown(;
    settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(),
    w::Option{<:ObsWeights} = nothing
) -> RelativeAverageDrawdown

Keywords correspond to the struct's fields.

Validation

  • If w is not nothing: !isempty(w).

Functor

julia
(r::RelativeAverageDrawdown)(x::VecNum)

Computes the Relative Average Drawdown of a portfolio returns vector x.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia
julia> RelativeAverageDrawdown()
RelativeAverageDrawdown
  settings ┼ HierarchicalRiskMeasureSettings
           │   scale ┴ Float64: 1.0
         w ┴ nothing

Related

source
PortfolioOptimisers.average_drawdown Function
julia
average_drawdown(dd::VecNum, ::Nothing) -> Number
average_drawdown(dd::VecNum, w::VecNum) -> Number

Aggregate 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, or nothing for the unweighted mean.

Returns

  • Number: Average drawdown, returned as a positive loss.

Related

source