Entropic X at Risk
PortfolioOptimisers.EntropicValueatRisk — Type
struct EntropicValueatRisk{__T_settings, __T_slv, __T_alpha, __T_w} <: RiskMeasureMeasures the Entropic Value-at-Risk (EVaR), the tightest upper bound on the Value-at-Risk that the Chernoff inequality gives.
The EVaR is a coherent risk measure, and it is an upper bound on the Conditional Value-at-Risk. ERM computes it with an exponential cone programme. It is also the divergence Ambiguity Set of the library, read as a risk measure: the worst expected loss over a Kullback-Leibler ball about the sample distribution, at radius $-\ln(\alpha)$.
Mathematical definition
The EVaR is the tightest exponential upper bound on the Value-at-Risk:
\[\begin{align} \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) &= \inf_{z > 0} \left\{ z \ln\!\left( \frac{M_{L}(1/z)}{\alpha} \right) \right\}\,. \end{align}\]
Where:
- $\mathrm{EVaR}_{\alpha}(\boldsymbol{x})$: Entropic Value-at-Risk.
- $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
- $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
- $L_t = -x_t$: Loss at period $t$.
- $M_L(u) = \mathbb{E}[e^{uL}]$: Moment-generating function of the loss.
- $z$: Exponential tilt parameter.
For a sample, the infimum is the minimum of an exponential cone programme:
\[\begin{align} \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) &= \underset{t,\, z,\, \boldsymbol{u}}{\min} \left\{ t - z \ln(\alpha T) \;:\; z \geq 0,\; \sum_{i=1}^{T} u_i \leq z,\; (-x_i - t,\, z,\, u_i) \in \mathcal{K}_{\exp}\; \forall i \right\}\,. \end{align}\]
Where:
- $T$: Number of observations.
- $t$, $z$: Scalar variables of the exponential cone programme.
- $u_i$: Variable of observation $i$ in the exponential cone programme.
- $\mathcal{K}_{\exp} = \mathrm{cl}\,\{(a,b,c) : b\, e^{a/b} \leq c,\, b > 0\}$: Exponential cone.
With observation weights $\boldsymbol{w}$, the radius term reads $\alpha W_{T}$ in place of $\alpha T$, and the budget row reads $\boldsymbol{w}^\intercal \boldsymbol{u} \leq z$. The natural logarithm takes the total weight out of the sum, so the measure is that of the probabilities $w_t / W_{T}$.
Where:
- $W_{T} = \sum_{t=1}^{T} w_{t}$: Total observation weight.
The dual of that programme is the worst expected loss over a Kullback-Leibler ball about the sample distribution:
\[\begin{align} \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) &= \underset{Q \in \mathcal{Q}_{\mathrm{KL}}(\alpha)}{\sup} \mathbb{E}_{Q}[L]\,, \\ \mathcal{Q}_{\mathrm{KL}}(\alpha) &= \left\{ Q : D_{\mathrm{KL}}(Q \,\|\, P) \leq -\ln(\alpha) \right\}\,. \end{align}\]
Where:
- $\mathcal{Q}_{\mathrm{KL}}(\alpha)$: Kullback-Leibler ambiguity ball of radius $-\ln(\alpha)$.
- $D_{\mathrm{KL}}(Q \,\|\, P) = \sum_{t=1}^{T} q_t \ln\!\left(\frac{q_t}{p_t}\right)$: Kullback-Leibler divergence.
- $Q$: Distribution in the ambiguity ball, whose $t$-th probability is $q_t$.
- $P$: Sample distribution of the losses, whose $t$-th probability is $p_t$. It is uniform over the $T$ observations, or the normalised observation weights when they are stated.
- $\mathbb{E}_{Q}[L] = \sum_{t=1}^{T} q_t L_t$: Expected loss under $Q$.
So the significance level is the Ambiguity Radius, through $-\ln(\alpha)$, and a smaller $\alpha$ widens the ball. The ball is a reading of this measure and not an object, so no estimator constructs one.
The definition has these consequences:
\[\begin{align} \mathrm{VaR}_{\alpha}(\boldsymbol{x}) \leq \mathrm{CVaR}_{\alpha}(\boldsymbol{x}) &\leq \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) \leq \max_{t} L_t\,, \\ \lim_{\alpha \to 1} \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) &= \mathbb{E}_{P}[L]\,. \end{align}\]
Where:
- $\mathrm{VaR}_{\alpha}$, $\mathrm{CVaR}_{\alpha}$: Value-at-Risk and Conditional Value-at-Risk at the same level $\alpha$.
- $\mathbb{E}_{P}[L]$: Expected loss under the sample distribution.
The EVaR falls as $\alpha$ rises. It does not reach the expected loss, because the constructor refuses $\alpha = 1$. At $\alpha = 0$ the EVaR is the largest loss among the observations of positive weight. With equal observation weights and $\alpha T \leq 1$, the ball holds every distribution on the sample, so the EVaR is the largest loss too.
[203] defines the EVaR. Section 7.2.2.6 of [12] states the definition, Equation 7.61, and the order above, Equation 7.62. It also writes the sample form as an exponential cone programme, Equations 7.63 and 7.64, and names an earlier work of its author as the source of that programme. No copy of that work was found. The weighted programme is the library's extension.
Fields
settings: Risk measure settings.
slv: Solver or vector of solvers.
alpha: Quantile level for the lower tail. The bound isNum_SigCal, so the slot takes the level itself, anAbstractSignificanceCalibrationAlgorithmthat computes it from the prior result, or a plain function of the same five arguments.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
Constructors
EntropicValueatRisk(; settings::RiskMeasureSettings = RiskMeasureSettings(), slv::Option{<:Slv_VecSlv} = nothing, alpha::Num_SigCal = 0.05, w::Option{<:ObsWeights} = nothing) -> EntropicValueatRiskKeywords correspond to the struct's fields.
Validation
- If
alphais a number:0 <= alpha < 1. Atalpha = 0the measure is the largest loss among the observations with positive weight,worst_positive_weight_loss, and an observation with zero weight cannot set it. - If
slvis aVecSlv:!isempty(slv). - 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::EntropicValueatRisk)(x::VecNum)Computes the EVaR of a portfolio returns vector x with ERM, and returns NaN when no solver of slv solves the programme. The functor needs a solver: with slv = nothing the call raises an IsNothingError that names slv, see checked_kernel_solver. factory fills slv from the solver of the optimiser.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> EntropicValueatRisk()EntropicValueatRisk settings ┼ RiskMeasureSettings │ scale ┼ Float64: 1.0 │ ub ┼ nothing │ rke ┴ Bool: true slv ┼ nothing alpha ┼ Float64: 0.05 w ┴ nothingRelated
RiskMeasureRiskMeasureSettingsRelativisticValueatRiskEntropicValueatRiskRangeEntropicDrawdownatRiskERMfactoryobs_weights_view
References
- [203] A. Ahmadi-Javid. Entropic value-at-risk: A new coherent risk measure. Journal of Optimization Theory and Applications 155, 1105–1123 (2012).
- [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.2.6, Equations 7.61 to 7.64. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
PortfolioOptimisers.EntropicValueatRiskRange — Type
struct EntropicValueatRiskRange{__T_settings, __T_slv, __T_alpha, __T_beta, __T_w} <: RangeRiskMeasureMeasures the spread of the returns as the sum of the Entropic Value-at-Risk of the losses and that of the gains.
The loss tail has the level alpha, and the gain tail has the level beta.
Mathematical definition
\[\begin{align} \mathrm{EVaRRange}_{\alpha,\beta}(\boldsymbol{x}) &= \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) + \mathrm{EVaR}_{\beta}(-\boldsymbol{x})\,. \end{align}\]
Where:
- $\mathrm{EVaRRange}_{\alpha,\beta}(\boldsymbol{x})$: EVaR range.
- $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
- $\mathrm{EVaR}_{\alpha}(\boldsymbol{x})$: Entropic Value-at-Risk of the losses at level $\alpha$.
- $\mathrm{EVaR}_{\beta}(-\boldsymbol{x})$: Entropic Value-at-Risk of the gains 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.
Each term is the worst expected loss over its own Kullback-Leibler ball about the sample distribution, at radius $-\ln(\alpha)$ on the lower tail and $-\ln(\beta)$ on the upper tail. EntropicValueatRisk states the ball.
Section 7.2.3.4 of [12] defines this range, and its Section 7.2.3 names [199] as the source of the range measures. No copy of that work was found. Equation 7.81 of [12] prints a difference of the two tails, but its bound, Equation 7.82, and its programme, Equation 7.83, state the sum above.
Fields
settings: Risk measure settings.
slv: Solver or vector of solvers.
alpha: Quantile level for the lower tail. The bound isNum_SigCal, so the slot takes the level itself, anAbstractSignificanceCalibrationAlgorithmthat computes it from the prior result, or a plain function of the same five arguments.
beta: Quantile level for the upper tail. The bound isNum_SigCal, so the slot takes the level itself, anAbstractSignificanceCalibrationAlgorithmthat computes it from the prior result, or a plain function of the same five arguments.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
Constructors
EntropicValueatRiskRange(; settings::RiskMeasureSettings = RiskMeasureSettings(), slv::Option{<:Slv_VecSlv} = nothing, alpha::Num_SigCal = 0.05, beta::Num_SigCal = alpha, w::Option{<:ObsWeights} = nothing) -> EntropicValueatRiskRangeKeywords correspond to the struct's fields.
Validation
- If
alphais a number:0 < alpha < 1. Ifbetais a number:0 < beta < 1. - If
slvis aVecSlv:!isempty(slv). - 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::EntropicValueatRiskRange)(x::VecNum)Computes the EVaR Range of a portfolio returns vector x with two calls of ERM. The functor needs a solver, as the functor of EntropicValueatRisk does.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> EntropicValueatRiskRange(; beta = 0.1)EntropicValueatRiskRange settings ┼ RiskMeasureSettings │ scale ┼ Float64: 1.0 │ ub ┼ nothing │ rke ┴ Bool: true slv ┼ nothing alpha ┼ Float64: 0.05 beta ┼ Float64: 0.1 w ┴ nothingRelated
RiskMeasureRiskMeasureSettingsEntropicValueatRiskRelativisticValueatRiskRangerange_tailsERMfactoryobs_weights_view
References
- [203] A. Ahmadi-Javid. Entropic value-at-risk: A new coherent risk measure. Journal of Optimization Theory and Applications 155, 1105–1123 (2012).
- [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.3.4, Equations 7.81 to 7.83. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
- [199] D. Cajas. OWA portfolio optimization: A disciplined convex programming framework. Available at SSRN 3988927 (2021).
PortfolioOptimisers.EntropicDrawdownatRisk — Type
struct EntropicDrawdownatRisk{__T_settings, __T_slv, __T_alpha, __T_w} <: RiskMeasureMeasures the Entropic Drawdown-at-Risk (EDaR), the Entropic Value-at-Risk of the absolute drawdown series of the portfolio.
The EDaR is an upper bound on the Drawdown-at-Risk and on the Conditional Drawdown-at-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 EDaR is the EVaR of the drawdown series:
\[\begin{align} \mathrm{EDaR}_{\alpha}(\boldsymbol{x}) &= \mathrm{EVaR}_{\alpha}(\boldsymbol{d}(\boldsymbol{x}))\,. \end{align}\]
Where:
- $\mathrm{EDaR}_{\alpha}(\boldsymbol{x})$: Entropic Drawdown-at-Risk.
- $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
- $\boldsymbol{d}(\boldsymbol{x})$: Absolute drawdown series vector $T \times 1$.
So the EDaR is the worst expected drawdown over a Kullback-Leibler ball about the sample distribution of $\boldsymbol{d}(\boldsymbol{x})$, at radius $-\ln(\alpha)$. EntropicValueatRisk states the ball. The order of that measure holds for the drawdowns too:
\[\begin{align} \mathrm{DaR}_{\alpha}(\boldsymbol{x}) \leq \mathrm{CDaR}_{\alpha}(\boldsymbol{x}) \leq \mathrm{EDaR}_{\alpha}(\boldsymbol{x}) \leq \mathrm{MDD}(\boldsymbol{x})\,. \end{align}\]
Where:
- $\mathrm{DaR}_{\alpha}$, $\mathrm{CDaR}_{\alpha}$: Drawdown-at-Risk and Conditional Drawdown-at-Risk at the same level $\alpha$.
- $\mathrm{MDD}(\boldsymbol{x}) = -\min_{t} d_t$: Maximum drawdown.
Equation 3.2 of [200] defines the drawdown, with the opposite sign. Section 7.2.4.5 of [12] defines the EDaR, Equation 7.95, and states the order above, Equation 7.96. It names an earlier work of its author as the source of the EDaR. No copy of that work was found.
Fields
settings: Risk measure settings.
slv: Solver or vector of solvers.
alpha: Quantile level for the lower tail. The bound isNum_SigCal, so the slot takes the level itself, anAbstractSignificanceCalibrationAlgorithmthat computes it from the prior result, or a plain function of the same five arguments.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
Constructors
EntropicDrawdownatRisk(; settings::RiskMeasureSettings = RiskMeasureSettings(), slv::Option{<:Slv_VecSlv} = nothing, alpha::Num_SigCal = 0.05, w::Option{<:ObsWeights} = nothing) -> EntropicDrawdownatRiskKeywords correspond to the struct's fields.
Validation
- If
alphais a number:0 <= alpha < 1. Atalpha = 0the measure is the largest loss among the observations with positive weight,worst_positive_weight_loss, and an observation with zero weight cannot set it. - If
slvis aVecSlv:!isempty(slv). - 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::EntropicDrawdownatRisk)(x::VecNum)Computes the EDaR of a portfolio returns vector x with ERM on its drawdown series. The functor needs a solver, as the functor of EntropicValueatRisk does.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> EntropicDrawdownatRisk()EntropicDrawdownatRisk settings ┼ RiskMeasureSettings │ scale ┼ Float64: 1.0 │ ub ┼ nothing │ rke ┴ Bool: true slv ┼ nothing alpha ┼ Float64: 0.05 w ┴ nothingRelated
RiskMeasureRiskMeasureSettingsEntropicValueatRiskRelativisticDrawdownatRiskRelativeEntropicDrawdownatRiskabsolute_drawdown_vecERMfactoryobs_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.
- [203] A. Ahmadi-Javid. Entropic value-at-risk: A new coherent risk measure. Journal of Optimization Theory and Applications 155, 1105–1123 (2012).
- [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.4.5, Equations 7.95 and 7.96. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
PortfolioOptimisers.RelativeEntropicDrawdownatRisk — Type
struct RelativeEntropicDrawdownatRisk{__T_settings, __T_slv, __T_alpha, __T_w} <: HierarchicalRiskMeasureMeasures the Relative Entropic Drawdown-at-Risk, the Entropic Value-at-Risk of the compounded drawdown series, for hierarchical optimisation.
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 EDaR is the EVaR of the relative drawdown series:
\[\begin{align} \mathrm{REDaR}_{\alpha}(\boldsymbol{x}) &= \mathrm{EVaR}_{\alpha}(\boldsymbol{rd}(\boldsymbol{x}))\,. \end{align}\]
Where:
- $\mathrm{REDaR}_{\alpha}(\boldsymbol{x})$: Relative Entropic Drawdown-at-Risk.
- $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
- $\boldsymbol{rd}(\boldsymbol{x})$: Relative drawdown series vector $T \times 1$.
So the Relative EDaR is the worst expected relative drawdown over a Kullback-Leibler ball about the sample distribution of $\boldsymbol{rd}(\boldsymbol{x})$, at radius $-\ln(\alpha)$. EntropicValueatRisk states the ball.
Section 3 of [200] defines the drawdown of the uncompounded cumulative return only, and Equation 7.95 of [12] defines the EDaR on that series. Neither work defines a measure on the relative drawdown, so this measure is the library's extension of them.
Fields
settings: Risk measure settings.
slv: Solver or vector of solvers.
alpha: Quantile level for the lower tail. The bound isNum_SigCal, so the slot takes the level itself, anAbstractSignificanceCalibrationAlgorithmthat computes it from the prior result, or a plain function of the same five arguments.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
Constructors
RelativeEntropicDrawdownatRisk(; settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(), slv::Option{<:Slv_VecSlv} = nothing, alpha::Num_SigCal = 0.05, w::Option{<:ObsWeights} = nothing) -> RelativeEntropicDrawdownatRiskKeywords correspond to the struct's fields.
Validation
- If
alphais a number:0 <= alpha < 1. Atalpha = 0the measure is the largest loss among the observations with positive weight,worst_positive_weight_loss, and an observation with zero weight cannot set it. - If
slvis aVecSlv:!isempty(slv). - 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::RelativeEntropicDrawdownatRisk)(x::VecNum)Computes the Relative EDaR of a portfolio returns vector x with ERM on its relative drawdown series. The functor needs a solver, as the functor of EntropicValueatRisk does.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> RelativeEntropicDrawdownatRisk()RelativeEntropicDrawdownatRisk settings ┼ HierarchicalRiskMeasureSettings │ scale ┴ Float64: 1.0 slv ┼ nothing alpha ┼ Float64: 0.05 w ┴ nothingRelated
HierarchicalRiskMeasureHierarchicalRiskMeasureSettingsEntropicDrawdownatRiskRelativeRelativisticDrawdownatRiskrelative_drawdown_vecERMfactoryobs_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.
- [203] A. Ahmadi-Javid. Entropic value-at-risk: A new coherent risk measure. Journal of Optimization Theory and Applications 155, 1105–1123 (2012).
- [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.4.5, Equation 7.95. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
References
- [12]
- D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
- [199]
- D. Cajas. OWA portfolio optimization: A disciplined convex programming framework. Available at SSRN 3988927 (2021).
- [200]
- A. Chekhlov, S. Uryasev and M. Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance 8, 13–58 (2005).
- [203]
- A. Ahmadi-Javid. Entropic value-at-risk: A new coherent risk measure. Journal of Optimization Theory and Applications 155, 1105–1123 (2012).