Relativistic X at Risk

PortfolioOptimisers.RelativisticValueatRisk — Type
struct RelativisticValueatRisk{__T_settings, __T_slv, __T_alpha, __T_kappa, __T_w} <: RiskMeasure

Measures the Relativistic Value-at-Risk (RLVaR), the worst expected loss over a Kaniadakis entropy ball about the sample distribution.

The RLVaR is a coherent risk measure. EntropicValueatRisk measures its ball with the Kullback-Leibler divergence, and the RLVaR tends to it as the deformation parameter $\kappa$ tends to zero.

Mathematical definition

The RLVaR is the worst expected loss over a Kaniadakis ball about the sample distribution:

\[\begin{align} \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{x}) &= \underset{Q \in \mathcal{Q}_{\kappa}(\alpha)}{\sup} \mathbb{E}_{Q}[L]\,, \\ \mathcal{Q}_{\kappa}(\alpha) &= \left\{ Q : \sum_{t=1}^{T} q_t \ln_{\kappa}\!\left(\frac{q_t}{p_t T}\right) \leq \ln_{\kappa}\!\left(\frac{1}{\alpha T}\right) \right\}\,. \end{align}\]

Where:

  • $\mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{x})$: Relativistic Value-at-Risk.
  • $\mathcal{Q}_{\kappa}(\alpha)$: Kaniadakis ambiguity ball of radius $\ln_{\kappa}\!\left(\frac{1}{\alpha T}\right)$.
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $\kappa$: Kaniadakis deformation parameter, $\kappa \in (0, 1)$.
  • $T$: Number of observations.
  • $\ln_{\kappa}(u) = \dfrac{u^{\kappa} - u^{-\kappa}}{2 \kappa}$: Kaniadakis logarithm.
  • $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$.
  • $L_t = -x_t$: Loss at period $t$.

The left side of the ball takes the place that the Kullback-Leibler divergence holds for EntropicValueatRisk. With equal observation weights $p_t = 1/T$, it is the negated Kaniadakis entropy of $Q$. The Kaniadakis logarithm does not change a product into a sum, so the sample size $T$ stays inside both sides, and neither side separates into a term in $T$ and a term in $\alpha$.

Conic duality gives the equivalent primal programme:

\[\begin{align} \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{x}) = \underset{t,\, z,\, \boldsymbol{\psi},\, \boldsymbol{\theta},\, \boldsymbol{\epsilon},\, \boldsymbol{\omega}}{\min} \quad & t + \ln_{\kappa}\!\left(\tfrac{1}{\alpha T}\right) z + T \sum_{i=1}^{T} p_i (\psi_i + \theta_i) \\ \mathrm{s.t.} \quad & \left(\tfrac{z(1+\kappa)}{2\kappa},\, \tfrac{\psi_i(1+\kappa)}{\kappa},\, \epsilon_i\right) \in \mathcal{K}_{\mathrm{pow}}\!\left(\tfrac{1}{1+\kappa}\right) \quad \forall i\,, \\ & \left(\tfrac{\omega_i}{1-\kappa},\, \tfrac{\theta_i}{\kappa},\, -\tfrac{z}{2\kappa}\right) \in \mathcal{K}_{\mathrm{pow}}(1-\kappa) \quad \forall i\,, \\ & \epsilon_i + \omega_i \leq x_i + t \quad \forall i\,, \\ & z \geq 0\,. \end{align}\]

Where:

  • $p_i$: Probability of observation $i$. It is $1/T$ without observation weights, and the $i$-th observation weight divided by the sum of the weights with them.
  • $t$: Shift variable of the primal programme.
  • $z \geq 0$: Scale variable of the primal power-cone programme.
  • $\psi_i$, $\theta_i$, $\epsilon_i$, $\omega_i$: Auxiliary variables of observation $i$ in the primal power-cone programme.
  • $\mathcal{K}_{\mathrm{pow}}(p) = \{(a,b,c) : a^{p} b^{1-p} \geq |c|,\, a \geq 0,\, b \geq 0\}$: Power cone.

With equal observation weights, the sum in the objective is $\sum_{i=1}^{T} (\psi_i + \theta_i)$. The radius keeps the argument $\frac{1}{\alpha T}$ when the weights are stated, because the Kaniadakis logarithm cannot absorb the weights into $\alpha T$ the way the natural logarithm does for EntropicValueatRisk.

Section 4.1 of [204] states the measure and both programmes for the uniform sample distribution, Equations 12 to 15, and the consequences below, Equations 16 and 17. The weighted ball, with the factor $p_t T$ in the programmes and in the cones, is the library's extension.

The definition has these consequences:

\[\begin{align} \lim_{\kappa \to 0} \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{x}) &= \mathrm{EVaR}_{\alpha}(\boldsymbol{x})\,, \\ \lim_{\kappa \to 1} \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{x}) &= \max_{t} L_t\,, \\ \mathrm{VaR}_{\alpha}(\boldsymbol{x}) \leq \mathrm{CVaR}_{\alpha}(\boldsymbol{x}) &\leq \mathrm{EVaR}_{\alpha}(\boldsymbol{x}) \leq \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{x}) \leq \max_{t} L_t\,. \end{align}\]

Where:

  • $\mathrm{VaR}_{\alpha}$, $\mathrm{CVaR}_{\alpha}$, $\mathrm{EVaR}_{\alpha}$: Value-at-Risk, Conditional Value-at-Risk and Entropic Value-at-Risk at the same level $\alpha$.

With equal observation weights and $\alpha T \leq 1$, the radius is not negative, so the ball holds every distribution on the sample, and the RLVaR is the largest loss $\max_{t} L_t$.

Fields

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

Constructors

RelativisticValueatRisk(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    slv::Option{<:Slv_VecSlv} = nothing,    alpha::Num_SigCal = 0.05,    kappa::Num_DefCal = 0.3,    w::Option{<:ObsWeights} = nothing) -> RelativisticValueatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If kappa is a number: 0 < kappa < 1.
  • If slv is a VecSlv: !isempty(slv).
  • If w is a StatsBase.AbstractWeights, it is not empty, each entry is finite and >= 0, and sum(w) > 0, through assert_observation_weights. A DynamicAbstractWeights holds no weights until it reads the data, so checked_observation_weights checks 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:

Observation weight parameters

obs_weights_view indexes these fields to the selected observations:

Functor

(r::RelativisticValueatRisk)(x::VecNum)

Computes the RLVaR of a portfolio returns vector x with RRM, 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> RelativisticValueatRisk()RelativisticValueatRisk  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true       slv ┼ nothing     alpha ┼ Float64: 0.05     kappa ┼ Float64: 0.3         w ┴ nothing

Related

References

  • [204] D. Cajas. Portfolio Optimization of Relativistic Value at Risk. Available at SSRN 4378498 (2023). Section 4.1, Equations 12 to 17.
source
PortfolioOptimisers.RelativisticValueatRiskRange — Type
struct RelativisticValueatRiskRange{__T_settings, __T_slv, __T_alpha, __T_kappa_a, __T_beta, __T_kappa_b, __T_w} <: RangeRiskMeasure

Measures the spread of the returns as the sum of the Relativistic Value-at-Risk of the losses and that of the gains.

The loss tail has the level alpha and the deformation kappa_a. The gain tail has the level beta and the deformation kappa_b.

Mathematical definition

\[\begin{align} \mathrm{RVaRRange}_{\alpha,\kappa_a,\beta,\kappa_b}(\boldsymbol{x}) &= \mathrm{RLVaR}_{\alpha,\kappa_a}(\boldsymbol{x}) + \mathrm{RLVaR}_{\beta,\kappa_b}(-\boldsymbol{x})\,. \end{align}\]

Where:

  • $\mathrm{RVaRRange}_{\alpha,\kappa_a,\beta,\kappa_b}(\boldsymbol{x})$: Relativistic VaR range.
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $\mathrm{RLVaR}_{\alpha,\kappa_a}(\boldsymbol{x})$: Lower-tail RLVaR with parameters $(\alpha, \kappa_a)$.
  • $\mathrm{RLVaR}_{\beta,\kappa_b}(-\boldsymbol{x})$: Upper-tail RLVaR with parameters $(\beta, \kappa_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.

Each term is the worst expected loss over its own Kaniadakis ball about the sample distribution. The first ball has the deformation $\kappa_a$ and the level $\alpha$, and the second ball has the deformation $\kappa_b$ and the level $\beta$. RelativisticValueatRisk states the ball.

Section 7.2.3.5 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.84 of [12] prints a difference of the two tails, but its bound, Equation 7.85, and its programme state the sum above.

Fields

  • settings: Risk measure settings.
  • slv: Solver or vector of solvers.
  • kappa_a: Relativistic deformation parameter for the lower tail. The bound is Num_DefCal, so the slot takes the parameter itself, an AbstractDeformationCalibrationAlgorithm that computes it from the prior result, or a plain function of the same five arguments.
  • kappa_b: Relativistic deformation parameter for the upper tail. The bound is Num_DefCal, so the slot takes the parameter itself, an AbstractDeformationCalibrationAlgorithm 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

RelativisticValueatRiskRange(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    slv::Option{<:Slv_VecSlv} = nothing,    alpha::Num_SigCal = 0.05,    kappa_a::Num_DefCal = 0.3,    beta::Num_SigCal = alpha,    kappa_b::Num_DefCal = kappa_a,    w::Option{<:ObsWeights} = nothing) -> RelativisticValueatRiskRange

Keywords correspond to the struct's fields.

Validation

  • Each of alpha and kappa_a that is a number: 0 < val < 1.
  • Each of beta and kappa_b that is a number: 0 < val < 1.
  • If slv is a VecSlv: !isempty(slv).
  • If w is a StatsBase.AbstractWeights, it is not empty, each entry is finite and >= 0, and sum(w) > 0, through assert_observation_weights. A DynamicAbstractWeights holds no weights until it reads the data, so checked_observation_weights checks 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:

Observation weight parameters

obs_weights_view indexes these fields to the selected observations:

Functor

(r::RelativisticValueatRiskRange)(x::VecNum)

Computes the RLVaR Range of a portfolio returns vector x with two calls of RRM. The functor needs a solver, as the functor of RelativisticValueatRisk does.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> RelativisticValueatRiskRange()RelativisticValueatRiskRange  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true       slv ┼ nothing     alpha ┼ Float64: 0.05   kappa_a ┼ Float64: 0.3      beta ┼ Float64: 0.05   kappa_b ┼ Float64: 0.3         w ┴ nothing

Related

References

  • [204] D. Cajas. Portfolio Optimization of Relativistic Value at Risk. Available at SSRN 4378498 (2023). Section 4.1, Equations 12 to 17.
  • [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.3.5, Equations 7.84 and 7.85. 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).
source
PortfolioOptimisers.RelativisticDrawdownatRisk — Type
struct RelativisticDrawdownatRisk{__T_settings, __T_slv, __T_alpha, __T_kappa, __T_w} <: RiskMeasure

Measures the Relativistic Drawdown-at-Risk (RLDaR), the Relativistic Value-at-Risk of the absolute drawdown series of the portfolio.

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 Relativistic Drawdown-at-Risk is the RLVaR of the drawdown series:

\[\begin{align} \mathrm{RLDaR}_{\alpha,\kappa}(\boldsymbol{x}) &= \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{d}(\boldsymbol{x}))\,. \end{align}\]

Where:

  • $\mathrm{RLDaR}_{\alpha,\kappa}(\boldsymbol{x})$: Relativistic Drawdown-at-Risk.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $\kappa$: Kaniadakis deformation parameter, $\kappa \in (0, 1)$.
  • $\boldsymbol{d}(\boldsymbol{x})$: Absolute drawdown series vector $T \times 1$.

So the RLDaR is the worst expected drawdown over a Kaniadakis ball about the sample distribution of $\boldsymbol{d}(\boldsymbol{x})$. RelativisticValueatRisk 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{RLDaR}_{\alpha,\kappa}(\boldsymbol{x}) \leq \mathrm{MDD}(\boldsymbol{x})\,. \end{align}\]

Where:

  • $\mathrm{DaR}_{\alpha}$, $\mathrm{CDaR}_{\alpha}$, $\mathrm{EDaR}_{\alpha}$: Drawdown-at-Risk, Conditional Drawdown-at-Risk and Entropic 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 4.3 of [204] defines the RLDaR, Equation 23, and its Section 4.4 states the programmes.

Fields

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

Constructors

RelativisticDrawdownatRisk(;    settings::RiskMeasureSettings = RiskMeasureSettings(),    slv::Option{<:Slv_VecSlv} = nothing,    alpha::Num_SigCal = 0.05,    kappa::Num_DefCal = 0.3,    w::Option{<:ObsWeights} = nothing) -> RelativisticDrawdownatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If kappa is a number: 0 < kappa < 1.
  • If slv is a VecSlv: !isempty(slv).
  • If w is a StatsBase.AbstractWeights, it is not empty, each entry is finite and >= 0, and sum(w) > 0, through assert_observation_weights. A DynamicAbstractWeights holds no weights until it reads the data, so checked_observation_weights checks 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:

Observation weight parameters

obs_weights_view indexes these fields to the selected observations:

Functor

(r::RelativisticDrawdownatRisk)(x::VecNum)

Computes the Relativistic Drawdown-at-Risk of a portfolio returns vector x with RRM on its drawdown series. The functor needs a solver, as the functor of RelativisticValueatRisk does.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

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

Related

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.
  • [204] D. Cajas. Portfolio Optimization of Relativistic Value at Risk. Available at SSRN 4378498 (2023). Sections 4.3 and 4.4, Equation 23.
source
PortfolioOptimisers.RelativeRelativisticDrawdownatRisk — Type
struct RelativeRelativisticDrawdownatRisk{__T_settings, __T_slv, __T_alpha, __T_kappa, __T_w} <: HierarchicalRiskMeasure

Measures the Relative Relativistic Drawdown-at-Risk, the Relativistic 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 Relativistic Drawdown-at-Risk is the RLVaR of the relative drawdown series:

\[\begin{align} \mathrm{RRDDaR}_{\alpha,\kappa}(\boldsymbol{x}) &= \mathrm{RLVaR}_{\alpha,\kappa}(\boldsymbol{rd}(\boldsymbol{x}))\,. \end{align}\]

Where:

  • $\mathrm{RRDDaR}_{\alpha,\kappa}(\boldsymbol{x})$: Relative Relativistic Drawdown-at-Risk.
  • $\alpha$: Significance level (left tail probability), $\alpha \in (0, 1)$.
  • $\kappa$: Kaniadakis deformation parameter, $\kappa \in (0, 1)$.
  • $\boldsymbol{rd}(\boldsymbol{x})$: Relative drawdown series vector $T \times 1$.

So the Relative RLDaR is the worst expected relative drawdown over a Kaniadakis ball about the sample distribution of $\boldsymbol{rd}(\boldsymbol{x})$. RelativisticValueatRisk states the ball.

Section 3 of [200] defines the drawdown of the uncompounded cumulative return only, and Equation 23 of [204] defines the RLDaR 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.
  • w: Optional observation weights vector observations × 1, or a concrete subtype of DynamicAbstractWeights. If nothing, the computation is unweighted.

Constructors

RelativeRelativisticDrawdownatRisk(;    settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(),    slv::Option{<:Slv_VecSlv} = nothing,    alpha::Num_SigCal = 0.05,    kappa::Num_DefCal = 0.3,    w::Option{<:ObsWeights} = nothing) -> RelativeRelativisticDrawdownatRisk

Keywords correspond to the struct's fields.

Validation

  • If alpha is a number: 0 < alpha < 1.
  • If kappa is a number: 0 < kappa < 1.
  • If slv is a VecSlv: !isempty(slv).
  • If w is a StatsBase.AbstractWeights, it is not empty, each entry is finite and >= 0, and sum(w) > 0, through assert_observation_weights. A DynamicAbstractWeights holds no weights until it reads the data, so checked_observation_weights checks 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:

Observation weight parameters

obs_weights_view indexes these fields to the selected observations:

Functor

(r::RelativeRelativisticDrawdownatRisk)(x::VecNum)

Computes the Relative Relativistic Drawdown-at-Risk of a portfolio returns vector x with RRM on its relative drawdown series. The functor needs a solver, as the functor of RelativisticValueatRisk does.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> RelativeRelativisticDrawdownatRisk()RelativeRelativisticDrawdownatRisk  settings ┼ HierarchicalRiskMeasureSettings           │   scale ┴ Float64: 1.0       slv ┼ nothing     alpha ┼ Float64: 0.05     kappa ┼ Float64: 0.3         w ┴ nothing

Related

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.
  • [204] D. Cajas. Portfolio Optimization of Relativistic Value at Risk. Available at SSRN 4378498 (2023). Section 4.3, Equation 23.
source

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).
[204]
D. Cajas. Portfolio Optimization of Relativistic Value at Risk. Available at SSRN 4378498 (2023).