Average Drawdown
PortfolioOptimisers.AverageDrawdown — Type
struct AverageDrawdown{__T_settings, __T_w} <: RiskMeasureMeasures the Average Drawdown, the mean depth of the uncompounded drawdown over the sample.
The drawdown series is the one of absolute_drawdown_vec: the cumulative return is a sum of the returns, and its running peak starts at $c_0 = 0$. RelativeAverageDrawdown takes the same mean of the compounded drawdown series.
Mathematical definition
\[\begin{align} \mathrm{ADD}(\boldsymbol{x}) &= -\frac{1}{T} \sum_{t=1}^{T} d_t\,. \end{align}\]
Where:
- $\mathrm{ADD}(\boldsymbol{x})$: Average drawdown.
- $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
- $d_t \leq 0$: Absolute drawdown at period $t$.
absolute_drawdown_vecstates the series. - $T$: Number of observations.
With observation weights, the measure takes the weighted mean:
\[\begin{align} \mathrm{ADD}(\boldsymbol{x}) &= -\frac{1}{W_{T}} \sum_{t=1}^{T} w_{t} d_t\,. \end{align}\]
Where:
- $w_{t}$: Observation weight of observation $t$.
- $W_{T} = \sum_{t=1}^{T} w_{t}$: Total observation weight.
The drawdown series reads the full return path, so an observation with zero weight still moves every later drawdown. A path that never falls below its running peak has an Average Drawdown of zero. The measure is the limit of ConditionalDrawdownatRisk as alpha rises to one, because the tail then holds the whole sample.
[200] defines the measure without weights. The weighted mean is the library's extension of that work.
Algorithm
- Compute the drawdown series with
absolute_drawdown_vec. - Resolve the observation weights with
checked_observation_weights. - Return
average_drawdownof the series and the weights.
Fields
settings: Risk measure settings.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
Constructors
AverageDrawdown(; settings::RiskMeasureSettings = RiskMeasureSettings(), w::Option{<:ObsWeights} = nothing) -> AverageDrawdownKeywords correspond to the struct's fields.
Validation
- If
wis aStatsBase.AbstractWeights, it is not empty, each entry is finite and>= 0, andsum(w) > 0, throughassert_observation_weights. ADynamicAbstractWeightsholds no weights until it reads the data, sochecked_observation_weightschecks it at evaluation, and also checks there that the weights have one entry for each observation.
Propagated parameters
factory passes its arguments on to these @fprop fields:
w: Replaced with the incomingObsWeights.
Observation weight parameters
obs_weights_view indexes these fields to the selected observations:
w: Indexed to the selected observations throughobs_weights_view.
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 ┴ nothingThe drawdown series of the path below is [0, -0.25, -0.1875, -0.3125, 0]. The last return lifts the cumulative return to a new peak. A weight of four on that period moves the mean towards zero.
julia> x = [0.125, -0.25, 0.0625, -0.125, 0.375];julia> AverageDrawdown()(x)0.15julia> AverageDrawdown(; w = pweights([1.0, 1.0, 1.0, 1.0, 4.0]))(x)0.09375Related
RiskMeasureRiskMeasureSettingsMaximumDrawdownUlcerIndexConditionalDrawdownatRiskRelativeAverageDrawdownaverage_drawdownfactoryobs_weights_view
References
- [200] A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005). Section 3.1, Definition 3.2, Equation 3.4.
PortfolioOptimisers.RelativeAverageDrawdown — Type
struct RelativeAverageDrawdown{__T_settings, __T_w} <: HierarchicalRiskMeasureMeasures the Relative Average Drawdown, the mean depth of the compounded drawdown over the sample.
The drawdown series is the one of relative_drawdown_vec: the wealth compounds the returns, and its running peak starts at $C_0 = 1$. Each drawdown is thus a fraction of the peak wealth. AverageDrawdown takes the same mean of the uncompounded series. The compounded wealth is a product of linear functions of the weights, so the library states no JuMP formulation of the measure, and it is a HierarchicalRiskMeasure.
Mathematical definition
\[\begin{align} \mathrm{RADD}(\boldsymbol{x}) &= -\frac{1}{T} \sum_{t=1}^{T} rd_t\,. \end{align}\]
Where:
- $\mathrm{RADD}(\boldsymbol{x})$: Relative average drawdown.
- $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
- $rd_t \leq 0$: Relative drawdown at period $t$.
relative_drawdown_vecstates the series. - $T$: Number of observations.
With observation weights, the measure takes the weighted mean, as AverageDrawdown states, with $rd_t$ in place of $d_t$.
Section 3 of [200] defines the drawdown of the uncompounded cumulative return only. It names the relative drawdown and states that it lacks the properties of the absolute drawdown, but it defines no measure on it. The mean of the relative drawdown series is the library's extension of that work.
Algorithm
- Compute the relative drawdown series with
relative_drawdown_vec. - Resolve the observation weights with
checked_observation_weights. - Return
average_drawdownof the series and the weights.
Fields
settings: Risk measure settings.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
Constructors
RelativeAverageDrawdown(; settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(), w::Option{<:ObsWeights} = nothing) -> RelativeAverageDrawdownKeywords correspond to the struct's fields.
Validation
- If
wis aStatsBase.AbstractWeights, it is not empty, each entry is finite and>= 0, andsum(w) > 0, throughassert_observation_weights. ADynamicAbstractWeightsholds no weights until it reads the data, sochecked_observation_weightschecks it at evaluation, and also checks there that the weights have one entry for each observation.
Propagated parameters
factory passes its arguments on to these @fprop fields:
w: Replaced with the incomingObsWeights.
Observation weight parameters
obs_weights_view indexes these fields to the selected observations:
w: Indexed to the selected observations throughobs_weights_view.
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 ┴ nothingOn the path of AverageDrawdown, the relative drawdown series is [0, -0.25, -0.203125, -0.302734375, -0.041259765625]. The compounded wealth does not reach a new peak at the last return, so the mean is larger than the 0.15 of the uncompounded series.
julia> x = [0.125, -0.25, 0.0625, -0.125, 0.375];julia> RelativeAverageDrawdown()(x)0.159423828125Related
HierarchicalRiskMeasureHierarchicalRiskMeasureSettingsAverageDrawdownRelativeMaximumDrawdownRelativeConditionalDrawdownatRiskaverage_drawdownfactoryobs_weights_view
References
- [200] A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005). Section 3, Equation 3.2.
References
- [200]
- A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005).