Conditional X at Risk

PortfolioOptimisers.ConditionalValueatRiskType
struct ConditionalValueatRisk{__T_settings, __T_alpha, __T_w} <: RiskMeasure

Represents the Conditional Value-at-Risk (CVaR) risk measure, also known as Expected Shortfall (ES).

ConditionalValueatRisk computes the expected loss given that the loss exceeds the Value-at-Risk at level alpha. It provides a coherent risk measure for tail risk quantification.

Mathematical definition

Let $\boldsymbol{x} = (x_1, \ldots, x_T)^\intercal$ be the portfolio returns vector. The CVaR (also known as Expected Shortfall) at level $\alpha$ is the expected loss in the worst $\alpha$ fraction of scenarios:

\[\begin{align} \mathrm{CVaR}_{\alpha}(\boldsymbol{x}) &= \underset{\nu}{\min} \left\{ -\nu + \frac{1}{\alpha T} \sum_{t=1}^{T} \max(\nu - x_t,\, 0) \right\}\,. \end{align}\]

Where:

  • $\mathrm{CVaR}_{\alpha}(\boldsymbol{x})$: Conditional Value-at-Risk (Expected Shortfall) at level $\alpha$.
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $T$: Number of observations.
  • $\nu$: Auxiliary variable (Value-at-Risk threshold).

Equivalently, it is the expected loss conditional on exceeding the VaR:

\[\begin{align} \mathrm{CVaR}_{\alpha}(\boldsymbol{x}) &= -\mathbb{E}\!\left[x \mid x \leq -\mathrm{VaR}_{\alpha}(\boldsymbol{x})\right]\,. \end{align}\]

Where:

  • $\mathrm{CVaR}_{\alpha}(\boldsymbol{x})$: CVaR as the expected loss conditional on exceeding the VaR threshold.
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $\mathrm{VaR}_{\alpha}(\boldsymbol{x})$: Value-at-Risk at level $\alpha$.

Fields

  • settings: Risk measure settings.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

ConditionalValueatRisk(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    w::Option{<:ObsWeights} = nothing) -> ConditionalValueatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If w is not nothing: !isempty(w).

Functor

(r::ConditionalValueatRisk)(x::VecNum)

Computes the CVaR of a portfolio returns vector x.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

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

Related

References

  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.2.4.
source
PortfolioOptimisers.DistributionallyRobustConditionalValueatRiskType
struct DistributionallyRobustConditionalValueatRisk{__T_settings, __T_alpha, __T_l, __T_r, __T_w} <: RiskMeasure

Represents the Distributionally Robust Conditional Value-at-Risk (DR-CVaR) risk measure.

DistributionallyRobustConditionalValueatRisk is a robust variant of CVaR that accounts for distributional uncertainty using Wasserstein ambiguity sets. It provides robustness against model misspecification in the tails of the return distribution. It is the Esfahani-Kuhn [93] reformulation of a mean-CVaR loss over a Wasserstein ball, and it is a measure of a portfolio: it is defined on the weight vector $\boldsymbol{w}$ and the scenario matrix, not on a realised return series.

Mathematical definition

Let $\hat{\mathbb{P}}$ be the empirical distribution of the $T$ scenarios $\boldsymbol{\xi}_{t}$, and let $\mathcal{B}_{r}(\hat{\mathbb{P}})$ be the type-1 Wasserstein ball of radius $r$ around it, restricted to the support $\boldsymbol{\xi} \geq -\boldsymbol{1}$. The measure is the worst-case mean of the mean-CVaR loss $\ell_{\tau}$ over that ball, minimised over the Value-at-Risk level $\tau$:

\[\begin{align} \mathrm{DR\text{-}CVaR}_{\alpha, l, r}(\boldsymbol{w}) &= \min_{\tau \in \mathbb{R}} \; \sup_{\mathbb{Q} \in \mathcal{B}_{r}(\hat{\mathbb{P}})} \; \mathbb{E}_{\mathbb{Q}}\left[\ell_{\tau}(\boldsymbol{\xi})\right]\\ \ell_{\tau}(\boldsymbol{\xi}) &= -\boldsymbol{w}^{\intercal} \boldsymbol{\xi} + l \left(\tau + \dfrac{1}{\alpha} \left(-\boldsymbol{w}^{\intercal} \boldsymbol{\xi} - \tau\right)_{+}\right)\,. \end{align}\]

Where:

  • $\mathrm{DR\text{-}CVaR}_{\alpha, l, r}(\boldsymbol{w})$: Distributionally Robust CVaR.
  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\boldsymbol{\xi}$: Asset returns scenario vector $N \times 1$.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $l$: Weight of the CVaR term in the loss, $l > 0$.
  • $r$: Wasserstein ball radius, $r > 0$.
  • $(\cdot)_{+} = \max(\cdot, 0)$.

The loss $\ell_{\tau}$ is piecewise linear in $\boldsymbol{\xi}$ with the two pieces $b_{i} \tau + a_{i} \boldsymbol{w}^{\intercal} \boldsymbol{\xi}$, where $a_{1} = -1$, $b_{1} = l$, $a_{2} = -1 - l/\alpha$ and $b_{2} = l (1 - 1/\alpha)$. Taking the dual of the inner supremum gives the conic program that is actually solved:

\[\begin{align} \min_{\tau,\, \lambda,\, \boldsymbol{s},\, \boldsymbol{u},\, \boldsymbol{v}} \quad & r \lambda + \dfrac{1}{T} \sum_{t=1}^{T} s_{t}\\ \textrm{s.t.} \quad & b_{i} \tau + a_{i} \boldsymbol{w}^{\intercal} \boldsymbol{\xi}_{t} + \boldsymbol{u}_{t}^{(i)\intercal} \left(\boldsymbol{\xi}_{t} + \boldsymbol{1}\right) \leq s_{t}\\ & \left\lVert -\boldsymbol{u}_{t}^{(i)} - a_{i} \boldsymbol{w} \right\rVert_{\infty} \leq \lambda\\ & \boldsymbol{u}_{t}^{(i)} \geq \boldsymbol{0} \quad \forall\, t \in 1 \ldots T,\; i \in \{1, 2\}\,. \end{align}\]

The dual variables $\boldsymbol{u}_{t}^{(i)}$ price the support constraint $\boldsymbol{\xi} \geq -\boldsymbol{1}$, and $\lambda$ bounds the dual-norm Lipschitz modulus of the loss. Two consequences follow, and both contradict a reading of the measure as CVaR plus a constant:

  • The robustness premium $r \lambda$ is not a constant. $\lambda$ is a decision variable that depends on $\boldsymbol{w}$, so $r$ cannot be factored out of the optimisation.
  • The loss carries a mean term that $l$ does not scale. At $r \to 0$ the ball collapses to $\hat{\mathbb{P}}$ and the measure reduces to $-\mathbb{E}[\boldsymbol{w}^{\intercal} \boldsymbol{\xi}] + l \, \mathrm{CVaR}_{\alpha}(\boldsymbol{w}^{\intercal} \boldsymbol{\xi})$, not to $\mathrm{CVaR}_{\alpha}$ alone.

Fields

  • settings: Risk measure settings.
  • l: Weight of the tail term in the Esfahani-Kuhn loss. The mean term is not scaled by it.
  • r: Radius of the type-1 Wasserstein ambiguity ball. It multiplies a decision variable, so it is not a constant offset.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

DistributionallyRobustConditionalValueatRisk(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    l::Num_AmbTwtCal = 1.0,    r::Num_AmbRadCal = 0.02,    w::Option{<:ObsWeights} = nothing) -> DistributionallyRobustConditionalValueatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If l is a number: l > 0 and finite.
  • If r is a number: r > 0 and finite.
  • If w is not nothing: !isempty(w).

Functor

(r::DistributionallyRobustConditionalValueatRisk)(x::VecNum)

Computes the plain CVaR of a portfolio returns vector x, at level alpha. The functor shares its method with ConditionalValueatRisk through the RMCVaR union, and it ignores l and r.

This is not an omission. The robust term $r \lambda$ is a function of the weight vector and the scenario matrix, and a realised return series carries neither, so it cannot be evaluated here. Use the measure inside a JuMP optimisation to get the robust value.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> DistributionallyRobustConditionalValueatRisk()DistributionallyRobustConditionalValueatRisk  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true     alpha ┼ Float64: 0.05         l ┼ Float64: 1.0         r ┼ Float64: 0.02         w ┴ nothing

Related

References

  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
  • [93] P. Mohajerin Esfahani and D. Kuhn. Data-driven distributionally robust optimization using the Wasserstein metric: performance guarantees and tractable reformulations. Mathematical Programming 171, 115–166 (2018).
source
PortfolioOptimisers.ConditionalValueatRiskRangeType
struct ConditionalValueatRiskRange{__T_settings, __T_alpha, __T_beta, __T_w} <: RiskMeasure

Represents the Conditional Value-at-Risk Range (CVaR Range) risk measure.

ConditionalValueatRiskRange evaluates the CVaR at level alpha on the portfolio returns and the CVaR at level beta on the negated portfolio returns, then sums the two to give the total spread between the downside and the upside expected tail.

Mathematical definition

\[\begin{align} \mathrm{CVaRRange}_{\alpha,\beta}(\boldsymbol{x}) &= \mathrm{CVaR}_{\alpha}(\boldsymbol{x}) + \mathrm{CVaR}_{\beta}(-\boldsymbol{x})\,. \end{align}\]

Where:

  • $\mathrm{CVaRRange}_{\alpha,\beta}(\boldsymbol{x})$: CVaR range (tail spread).
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $\mathrm{CVaR}_{\alpha}(\boldsymbol{x})$: Lower-tail expected shortfall at level $\alpha$.
  • $\mathrm{CVaR}_{\beta}(-\boldsymbol{x})$: Upper-tail expected surplus at level $\beta$.

The upper tail is the base measure applied to the negated returns $-\boldsymbol{x}$, so both tails are reported on the same sign convention and the range is their sum, not their difference.

Fields

  • settings: Risk measure settings.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

ConditionalValueatRiskRange(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    beta::Num_SigCal = alpha,    w::Option{<:ObsWeights} = nothing) -> ConditionalValueatRiskRange

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If beta is a number: 0 < beta < 1.
  • If w is not nothing: !isempty(w).

Functor

(r::ConditionalValueatRiskRange)(x::VecNum)

Computes the CVaR Range of a portfolio returns vector x, as the sum of the two tail averages. The functor shares its method with DistributionallyRobustConditionalValueatRiskRange through the RMCVaRRg union. That method holds the upper tail in the negated convention of ConditionalValueatRisk, so it writes the sum as loss - gain.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> ConditionalValueatRiskRange()ConditionalValueatRiskRange  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true     alpha ┼ Float64: 0.05      beta ┼ Float64: 0.05         w ┴ nothing

Related

References

  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.3.
source
PortfolioOptimisers.DistributionallyRobustConditionalValueatRiskRangeType
struct DistributionallyRobustConditionalValueatRiskRange{__T_settings, __T_alpha, __T_l_a, __T_r_a, __T_beta, __T_l_b, __T_r_b, __T_w} <: RiskMeasure

Represents the Distributionally Robust Conditional Value-at-Risk Range (DR-CVaR Range) risk measure.

DistributionallyRobustConditionalValueatRiskRange evaluates the DR-CVaR at level alpha on the portfolio returns and the DR-CVaR at level beta on the negated portfolio returns, then sums the two to give the total spread between the downside and the upside robust tail. Each tail carries its own Wasserstein ambiguity parameters.

Mathematical definition

\[\begin{align} \mathrm{DR\text{-}CVaRRange}(\boldsymbol{x}) &= \mathrm{DR\text{-}CVaR}_{\alpha, l_a, r_a}(\boldsymbol{x}) + \mathrm{DR\text{-}CVaR}_{\beta, l_b, r_b}(-\boldsymbol{x})\,. \end{align}\]

Where:

  • $\mathrm{DR\text{-}CVaRRange}(\boldsymbol{x})$: DR-CVaR range.
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $\mathrm{DR\text{-}CVaR}_{\alpha, l_a, r_a}(\boldsymbol{x})$: Lower-tail DR-CVaR with Wasserstein parameters $(l_a, r_a)$.
  • $\mathrm{DR\text{-}CVaR}_{\beta, l_b, r_b}(-\boldsymbol{x})$: Upper-tail DR-CVaR with Wasserstein parameters $(l_b, r_b)$.

The upper tail is the base measure applied to the negated returns $-\boldsymbol{x}$, so both tails are reported on the same sign convention and the range is their sum, not their difference.

Fields

  • settings: Risk measure settings.
  • l_a: Weight of the tail term in the Esfahani-Kuhn loss of the lower tail. The mean term is not scaled by it. The bound is Num_AmbTwtCal, so the slot takes the weight itself, an AbstractAmbiguityTailWeightCalibrationAlgorithm that computes it from the prior result, or a plain function of the same five arguments.
  • r_a: Radius of the type-1 Wasserstein ambiguity ball of the lower tail. It multiplies a decision variable, so it is not a constant offset. The bound is Num_AmbRadCal, so the slot takes the radius itself, an AbstractAmbiguityRadiusCalibrationAlgorithm that computes it from the prior result, or a plain function of the same five arguments.
  • l_b: Weight of the tail term in the Esfahani-Kuhn loss of the upper tail. The mean term is not scaled by it. The bound is Num_AmbTwtCal, so the slot takes the weight itself, an AbstractAmbiguityTailWeightCalibrationAlgorithm that computes it from the prior result, or a plain function of the same five arguments.
  • r_b: Radius of the type-1 Wasserstein ambiguity ball of the upper tail. It multiplies a decision variable, so it is not a constant offset. The bound is Num_AmbRadCal, so the slot takes the radius itself, an AbstractAmbiguityRadiusCalibrationAlgorithm that computes it from the prior result, or a plain function of the same five arguments.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

DistributionallyRobustConditionalValueatRiskRange(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    l_a::Num_AmbTwtCal = 1.0,    r_a::Num_AmbRadCal = 0.02,    beta::Num_SigCal = alpha,    l_b::Num_AmbTwtCal = 1.0,    r_b::Num_AmbRadCal = 0.02,    w::Option{<:ObsWeights} = nothing) -> DistributionallyRobustConditionalValueatRiskRange

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If beta is a number: 0 < beta < 1.
  • Each of l_a, r_a, l_b and r_b that is a number: > 0 and finite.
  • If w is not nothing: !isempty(w).

Functor

(r::DistributionallyRobustConditionalValueatRiskRange)(x::VecNum)

Computes the plain CVaR Range of a portfolio returns vector x, at levels alpha and beta. The functor shares its method with ConditionalValueatRiskRange through the RMCVaRRg union, and it ignores l_a, r_a, l_b and r_b.

This is not an omission. Each robust term $r \lambda$ is a function of the weight vector and the scenario matrix, and a realised return series carries neither, so it cannot be evaluated here. Use the measure inside a JuMP optimisation to get the robust value.

The method returns the sum of the two tail averages. It holds the upper tail in the negated convention of ConditionalValueatRisk, so it writes the sum as loss - gain.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> DistributionallyRobustConditionalValueatRiskRange()DistributionallyRobustConditionalValueatRiskRange  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true     alpha ┼ Float64: 0.05       l_a ┼ Float64: 1.0       r_a ┼ Float64: 0.02      beta ┼ Float64: 0.05       l_b ┼ Float64: 1.0       r_b ┼ Float64: 0.02         w ┴ nothing

Related

References

  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
  • [93] P. Mohajerin Esfahani and D. Kuhn. Data-driven distributionally robust optimization using the Wasserstein metric: performance guarantees and tractable reformulations. Mathematical Programming 171, 115–166 (2018).
source
PortfolioOptimisers.ConditionalDrawdownatRiskType
struct ConditionalDrawdownatRisk{__T_settings, __T_alpha, __T_w} <: RiskMeasure

Represents the Conditional Drawdown-at-Risk (CDaR) risk measure, also known as Expected Maximum Drawdown.

ConditionalDrawdownatRisk computes the expected drawdown given that the drawdown exceeds the Drawdown-at-Risk at level alpha. It provides a coherent risk measure for drawdown tail risk.

Mathematical definition

Define the absolute drawdown series:

\[\begin{align} c_t &= \sum_{s=1}^{t} x_s\,, \\ d_t &= c_t - \max_{0 \leq s \leq t} c_s \leq 0\,. \end{align}\]

Where:

  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $c_t$: Cumulative simple portfolio return at period $t$.
  • $d_t \leq 0$: Absolute drawdown at period $t$.

The CDaR is the CVaR of the drawdown series $\boldsymbol{d} = (d_1, \ldots, d_T)^\intercal$:

\[\begin{align} \mathrm{CDaR}_{\alpha}(\boldsymbol{x}) &= \underset{\nu}{\min} \left\{ -\nu + \frac{1}{\alpha T} \sum_{t=1}^{T} \max(\nu - d_t,\, 0) \right\}\,. \end{align}\]

Where:

  • $\mathrm{CDaR}_{\alpha}(\boldsymbol{x})$: Conditional Drawdown-at-Risk (Expected Maximum Drawdown).
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $T$: Number of observations.
  • $d_t \leq 0$: Absolute drawdown at period $t$.
  • $\nu$: Auxiliary variable (DaR threshold).

Fields

  • settings: Risk measure settings.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

ConditionalDrawdownatRisk(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    w::Option{<:ObsWeights} = nothing) -> ConditionalDrawdownatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If w is not nothing: !isempty(w).

Functor

(r::ConditionalDrawdownatRisk)(x::VecNum)

Computes the CDaR of a portfolio returns vector x.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

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

Related

References

  • [102] A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005).
  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
source
PortfolioOptimisers.DistributionallyRobustConditionalDrawdownatRiskType
struct DistributionallyRobustConditionalDrawdownatRisk{__T_settings, __T_alpha, __T_l, __T_r, __T_w} <: RiskMeasure

Represents the Distributionally Robust Conditional Drawdown-at-Risk (DR-CDaR) risk measure.

DistributionallyRobustConditionalDrawdownatRisk is a robust variant of CDaR that accounts for distributional uncertainty using Wasserstein ambiguity sets, applied to drawdown sequences. It is the drawdown twin of DistributionallyRobustConditionalValueatRisk: the same Esfahani-Kuhn [93] reformulation, with the uncompounded portfolio drawdown path in place of the portfolio return.

Mathematical definition

Let $d_{t}(\boldsymbol{w})$ be the uncompounded portfolio drawdown at period $t$, a non-negative number. The measure is the worst-case mean of the mean-CDaR loss $\ell_{\tau}$ over a type-1 Wasserstein ball of radius $r$ around the empirical distribution of the drawdown path, minimised over the Drawdown-at-Risk level $\tau$:

\[\begin{align} \mathrm{DR\text{-}CDaR}_{\alpha, l, r}(\boldsymbol{w}) &= \min_{\tau \in \mathbb{R}} \; \sup_{\mathbb{Q} \in \mathcal{B}_{r}(\hat{\mathbb{P}})} \; \mathbb{E}_{\mathbb{Q}}\left[\ell_{\tau}(d)\right]\\ \ell_{\tau}(d) &= d + l \left(\tau + \dfrac{1}{\alpha} \left(d - \tau\right)_{+}\right)\,. \end{align}\]

Where:

  • $\mathrm{DR\text{-}CDaR}_{\alpha, l, r}(\boldsymbol{w})$: Distributionally Robust CDaR.
  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $d$: Uncompounded portfolio drawdown, $d \geq 0$.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $l$: Weight of the CDaR term in the loss, $l > 0$.
  • $r$: Wasserstein ball radius, $r > 0$.
  • $(\cdot)_{+} = \max(\cdot, 0)$.

The two pieces of $\ell_{\tau}$ and the dual conic program are those of DistributionallyRobustConditionalValueatRisk, with $-d_{t}$ substituted for $\boldsymbol{w}^{\intercal} \boldsymbol{\xi}_{t}$ and the drawdown support constraint $d \geq -1$ priced by the same non-negative dual variables. The same two consequences hold: $r$ multiplies a decision variable and cannot be factored out, and the mean drawdown term is not scaled by $l$. At $r \to 0$ the measure reduces to $\mathbb{E}[d] + l \, \mathrm{CDaR}_{\alpha}(d)$, not to $\mathrm{CDaR}_{\alpha}$ alone.

Fields

  • settings: Risk measure settings.
  • l: Weight of the tail term in the Esfahani-Kuhn loss. The mean term is not scaled by it.
  • r: Radius of the type-1 Wasserstein ambiguity ball. It multiplies a decision variable, so it is not a constant offset.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

DistributionallyRobustConditionalDrawdownatRisk(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    l::Num_AmbTwtCal = 1.0,    r::Num_AmbRadCal = 0.02,    w::Option{<:ObsWeights} = nothing) -> DistributionallyRobustConditionalDrawdownatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If l is a number: l > 0 and finite.
  • If r is a number: r > 0 and finite.
  • If w is not nothing: !isempty(w).

Functor

(r::DistributionallyRobustConditionalDrawdownatRisk)(x::VecNum)

Computes the plain CDaR of a portfolio returns vector x, at level alpha, and ignores l and r. The robust term $r \lambda$ is a function of the weight vector and the scenario matrix, and a realised return series carries neither, so it cannot be evaluated here. Use the measure inside a JuMP optimisation to get the robust value.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> DistributionallyRobustConditionalDrawdownatRisk()DistributionallyRobustConditionalDrawdownatRisk  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true     alpha ┼ Float64: 0.05         l ┼ Float64: 1.0         r ┼ Float64: 0.02         w ┴ nothing

Related

References

  • [102] A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005).
  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
  • [93] P. Mohajerin Esfahani and D. Kuhn. Data-driven distributionally robust optimization using the Wasserstein metric: performance guarantees and tractable reformulations. Mathematical Programming 171, 115–166 (2018).
source
PortfolioOptimisers.RelativeConditionalDrawdownatRiskType
struct RelativeConditionalDrawdownatRisk{__T_settings, __T_alpha, __T_w} <: HierarchicalRiskMeasure

Represents the Relative Conditional Drawdown-at-Risk risk measure for hierarchical optimisation.

RelativeConditionalDrawdownatRisk computes the expected relative (compounded) drawdown given that the drawdown exceeds the Relative Drawdown-at-Risk at level alpha.

Mathematical definition

Define the compounded wealth process and relative drawdown series:

\[\begin{align} C_t &= \prod_{s=1}^{t} (1 + x_s)\,, \\ rd_t &= \frac{C_t}{\max_{0 \leq s \leq t} C_s} - 1 \leq 0\,. \end{align}\]

Where:

  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $C_t$: Compound wealth process at period $t$.
  • $rd_t \leq 0$: Relative drawdown at period $t$.

The Relative CDaR is the CVaR of the relative drawdown series $\boldsymbol{rd}$:

\[\begin{align} \mathrm{RCDaR}_{\alpha}(\boldsymbol{x}) &= \underset{\nu}{\min} \left\{ -\nu + \frac{1}{\alpha T} \sum_{t=1}^{T} \max(\nu - rd_t,\, 0) \right\}\,. \end{align}\]

Where:

  • $\mathrm{RCDaR}_{\alpha}(\boldsymbol{x})$: Relative Conditional Drawdown-at-Risk.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $T$: Number of observations.
  • $rd_t \leq 0$: Relative drawdown at period $t$.
  • $\nu$: Auxiliary variable (RDaR threshold).

Fields

  • settings: Risk measure settings.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

RelativeConditionalDrawdownatRisk(;    settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(),    alpha::Num_SigCal = 0.05,    w::Option{<:ObsWeights} = nothing) -> RelativeConditionalDrawdownatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If w is not nothing: !isempty(w).

Functor

(r::RelativeConditionalDrawdownatRisk)(x::VecNum)

Computes the Relative CDaR of a portfolio returns vector x.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> RelativeConditionalDrawdownatRisk()RelativeConditionalDrawdownatRisk  settings ┼ HierarchicalRiskMeasureSettings           │   scale ┴ Float64: 1.0     alpha ┼ Float64: 0.05         w ┴ nothing

Related

References

  • [102] A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005).
  • [103] R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).
source

References

[5]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
[93]
P. Mohajerin Esfahani and D. Kuhn. Data-driven distributionally robust optimization using the Wasserstein metric: performance guarantees and tractable reformulations. Mathematical Programming 171, 115–166 (2018).
[102]
A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005).
[103]
R. T. Rockafellar and S. Uryasev. Optimization of conditional value-at-risk. Journal of Risk 2, 21–41 (2000).