Kurtosis Constraints
The methods below are public. The other names of this topic are private, and the private page documents them.
PortfolioOptimisers.set_risk_constraints! — Method
set_risk_constraints!(
model::Model,
i,
r::Kurtosis{<:Any, <:Any, <:Integer},
opt::Union{AbstractProgrammeAllocationSet, RiskJuMPOptimisationEstimator},
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> Any
Add the approximate kurtosis of a Kurtosis to the model, and return its risk expression.
This method applies when r.N is an integer. cokurtosis_spectrum writes the fourth moment as a sum of $N^2$ squared quadratic forms, and the method keeps the $N_f$ forms of the largest eigenvalues. A larger r.N is more accurate and more expensive. The rank of $\mathbf{K}$ is at most $N(N+1)/2$, so every $N_f \geq N(N+1)/2$ keeps every form whose eigenvalue is not zero.
The method reads the measure's kt when the measure states one, and the prior's otherwise. It accepts any prior result, and assert_high_order_quantity refuses the measure when neither holds a cokurtosis matrix. Every approximate measure of the model that reads the prior's matrix reads one decomposition, get_kt_Akt_pm.
Mathematical definition
\[\begin{align} \widetilde{m}_4(\boldsymbol{w}) &= \sum_{i=1}^{N_f} \left(\boldsymbol{w}^\intercal \mathbf{B}_i \boldsymbol{w}\right)^2 \leq m_4(\boldsymbol{w})\,. \end{align}\]
Where:
- $\widetilde{m}_4(\boldsymbol{w})$: Approximate fourth central moment of the portfolio returns.
- $N_f$: Number of forms that the method keeps,
r.Nclamped to the range from $1$ to $N$, times $N$. - $m_4(\boldsymbol{w}) = (\boldsymbol{w} \otimes \boldsymbol{w})^\intercal \mathbf{K} (\boldsymbol{w} \otimes \boldsymbol{w})$: Fourth central moment of the portfolio returns, with $\otimes$ the Kronecker product.
- $\mathbf{B}_i$: $N \times N$ matrix of eigenpair $i$ of the block vectorisation of $\mathbf{K}$, the reshaped $\sqrt{\lambda_i}\, \boldsymbol{q}_i$.
cokurtosis_spectrumgives the eigenvalue $\lambda_i$, clamped at zero, and the unit eigenvector $\boldsymbol{q}_i$. The index $i$ counts down from the largest eigenvalue. - $\mathbf{K}$: Cokurtosis matrix of the risk measure, $N^2 \times N^2$. It is the measure's own
ktwhen the measure states one, and the prior's otherwise. - $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
The model replaces $\boldsymbol{w} \boldsymbol{w}^\intercal$ with the lift $\mathbf{W}$, so each quadratic form becomes $\mathrm{Tr}(\mathbf{B}_i \mathbf{W})$, which is affine in the variables. A second-order cone bounds the norm of the vector of the $N_f$ forms.
Algorithm
- Check that
r.ktorprholds a cokurtosis matrix, withassert_high_order_quantity. - Read
sc, the constraint scale, andW, the lift ofset_sdp_constraints!. - Compute
Nf, which isr.Nclamped to1:N, timesN. - Create
sqrt_kurtosis_riskandx_kurt, and register them under their keys. - Read
vals_Aandvecs_A, the spectrum ofr.ktfromcokurtosis_spectrum, else the spectrum of the prior's matrix fromget_kt_Akt_pm. - Build
Bi, the matrices of theNflargest eigenvalues. - Register the two rows below under their keys.
- Bound
sqrt_kurtosis_riskand add the risk expression withset_kurtosis_risk!, and return the risk expression.
JuMP formulation
Variables
W: read, $\mathbf{W}$, the lift thatset_sdp_constraints!builds once for the owner of the weights.kurtosis_risk_: created, the scalar $g$.x_kurt_: created, the vector $\boldsymbol{x}_{kt}$ of $N_f$ entries.
Constraints
capprox_kurt_soc_: $(s_c g,\, s_c \boldsymbol{x}_{kt}) \in \mathcal{K}_{2}$, which is $g \geq \lVert \boldsymbol{x}_{kt} \rVert_2$.capprox_kurt_: $s_c \left(x_{kt,j} - \mathrm{Tr}(\mathbf{B}_j \mathbf{W})\right) = 0$, $\forall\, j = 1,\ldots,N_f$.
Each name carries the index i of the measure, and the namespace prefix.
Where:
- $g$: Epigraph variable of the square root of the kurtosis, $g \geq \lVert \boldsymbol{x}_{kt} \rVert_{2}$.
- $\boldsymbol{x}_{kt}$: Vector whose squared norm is the kurtosis expression. The exact formulation states $\mathbf{G}_{kt} \mathbf{L}_2 \mathrm{vec}(\mathbf{W})$, and the approximate formulation states entry $j$ as $\mathrm{Tr}(\mathbf{B}_j \mathbf{W})$.
- $\mathbf{W}$: Lifted weight matrix, symmetric $N \times N$.
set_sdp_constraints!bounds it by $\mathbf{W} \succeq \boldsymbol{w} \boldsymbol{w}^\intercal / k$. - $k$: Variable that scales the budget in the homogenised problem.
- $\mathcal{K}_{q} = \{(t, \boldsymbol{x}) : t \geq \lVert \boldsymbol{x} \rVert_{q}\}$: Norm cone of order $q$. $\mathcal{K}_{2}$ is the second-order cone.
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
Relaxation
The encoding is not exact: the entries below bound the quantity instead of reproducing it, and the bound is tight only under the condition stated here.
- At $\mathbf{W} = \boldsymbol{w} \boldsymbol{w}^\intercal / k$, $\lVert \boldsymbol{x}_{kt} \rVert_2^2 = \widetilde{m}_4(\boldsymbol{w}) / k^2$, which lies at or below $m_4(\boldsymbol{w}) / k^2$. The two are equal when $N_f \geq N(N+1)/2$.
- With $N_f \geq N(N+1)/2$, $\lVert \boldsymbol{x}_{kt} \rVert_2^2$ is the squared norm of the exact formulation in another basis, and the relaxation of the exact formulation applies. With a smaller $N_f$ the expression bounds $m_4$ in neither direction away from rank one.
kurtosis_risk_lies at or above $\lVert \boldsymbol{x}_{kt} \rVert_2$. It is tight when the objective minimises the risk.- A bound on
kurtosis_risk_holds the weights to $\widetilde{m}_4$, not to $m_4$. With $N_f < N(N+1)/2$ the returned weights can have a fourth moment above the bound.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::Kurtosis: The measure, read forkt,N,algandsettings.opt::RiskConstraintOwner: The owner of the risk constraint, a risk-based JuMP optimisation estimator or a programme Allocation Set.pr::AbstractPriorResult: The prior result. It suppliesktwhen the measure states none.
Keyword arguments
prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).
Validation
r.ktorprholds a cokurtosis matrix.assert_high_order_quantityraises anArgumentErrorotherwise.
Returns
risk: The kurtosis risk expression ofset_kurtosis_risk!.
Related
Kurtosiscokurtosis_spectrumget_kt_Akt_pmset_kurtosis_risk!set_sdp_constraints!assert_high_order_quantity
References
- [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.5.2, Equations 7.110 and 7.111. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
- [195] D. Cajas. Approximation of Portfolio Kurtosis through Sum of Squared Quadratic Forms. Available at SSRN 4472793 (2023).
PortfolioOptimisers.set_risk_constraints! — Method
set_risk_constraints!(
model::Model,
i,
r::Kurtosis{<:Any, <:Any, Nothing},
opt::Union{AbstractProgrammeAllocationSet, RiskJuMPOptimisationEstimator},
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> Any
Add the kurtosis of a Kurtosis to the model in the exact semidefinite formulation, and return its risk expression.
This method applies when r.N is nothing. It is problem 13 of [66], with the budget homogenised by $k$. Equation 6 of that work states the fourth moment as a quadratic form in the entries on and below the diagonal of $\boldsymbol{w} \boldsymbol{w}^\intercal$, and the model replaces $\boldsymbol{w} \boldsymbol{w}^\intercal$ with the lift $\mathbf{W}$.
The method reads the measure's kt when the measure states one, and the prior's otherwise. Every exact measure of the model that reads the prior's matrix reads one factor, get_chol_or_Gkt_pm. The elimination and summation matrices come from dup_elim_sum_selector. They depend on the number of assets alone, so the method builds under a LowOrderPrior when the measure holds its own cokurtosis matrix. assert_high_order_quantity refuses the measure when neither holds one.
Mathematical definition
\[\begin{align} m_4(\boldsymbol{w}) &= \left[\mathbf{L}_2 \mathrm{vec}(\boldsymbol{w} \boldsymbol{w}^\intercal)\right]^\intercal \mathbf{S}_2 \mathbf{K} \mathbf{S}_2^\intercal \left[\mathbf{L}_2 \mathrm{vec}(\boldsymbol{w} \boldsymbol{w}^\intercal)\right] = \left\lVert \mathbf{G}_{kt} \mathbf{L}_2 \mathrm{vec}(\boldsymbol{w} \boldsymbol{w}^\intercal) \right\rVert_2^2\,. \end{align}\]
Where:
- $m_4(\boldsymbol{w}) = (\boldsymbol{w} \otimes \boldsymbol{w})^\intercal \mathbf{K} (\boldsymbol{w} \otimes \boldsymbol{w})$: Fourth central moment of the portfolio returns, with $\otimes$ the Kronecker product.
- $\mathbf{L}_2$: Elimination matrix, $N(N+1)/2 \times N^2$, which
dup_elim_sum_matricesbuilds. $\mathbf{L}_2 \mathrm{vec}(\mathbf{A})$ holds the entries on and below the diagonal of $\mathbf{A}$, column by column. - $\mathbf{S}_2$: Summation matrix, $N(N+1)/2 \times N^2$, which
dup_elim_sum_matricesbuilds. For a symmetric $\mathbf{A}$, $\mathbf{S}_2 \mathrm{vec}(\mathbf{A})$ holds each entry on and below the diagonal of $\mathbf{A}$, times the number of times it occurs in $\mathbf{A}$. - $\mathbf{K}$: Cokurtosis matrix of the risk measure, $N^2 \times N^2$. It is the measure's own
ktwhen the measure states one, and the prior's otherwise. - $\mathbf{G}_{kt}$: Factor of the projected cokurtosis matrix, $N(N+1)/2 \times N(N+1)/2$, with $\mathbf{G}_{kt}^\intercal \mathbf{G}_{kt} = \mathbf{S}_2 \mathbf{K} \mathbf{S}_2^\intercal$. It is the transpose of the square root that
matrix_square_roottakes under themtx_sqrtof the measure. - $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
Algorithm
- Check that
r.ktorprholds a cokurtosis matrix, withassert_high_order_quantity. - Read
sc, the constraint scale, andW, the lift ofset_sdp_constraints!. - Read
L2andS2for the size ofW, withdup_elim_sum_selector. - Read
G, the factor ofr.ktprojected byS2underr.mtx_sqrt, else the factor of the prior's matrix fromget_chol_or_Gkt_pm. - Create
sqrt_kurtosis_risk, and register it under its key. - Build
L2Wonce for the namespace, and buildx_kurt. - Register the cone row below under its key.
- Bound
sqrt_kurtosis_riskand add the risk expression withset_kurtosis_risk!, and return the risk expression.
JuMP formulation
Variables
W: read, $\mathbf{W}$, the lift thatset_sdp_constraints!builds once for the owner of the weights.kurtosis_risk_: created, the scalar $g$.
Expressions
L2W: $\mathbf{L}_2 \mathrm{vec}(\mathbf{W})$, registered once for each namespace.x_kurt_: $\boldsymbol{x}_{kt} = \mathbf{G}_{kt} \mathbf{L}_2 \mathrm{vec}(\mathbf{W})$.
Constraints
ckurt_soc_: $(s_c g,\, s_c \boldsymbol{x}_{kt}) \in \mathcal{K}_{2}$, which is $g \geq \lVert \boldsymbol{x}_{kt} \rVert_2$.
Each name except L2W carries the index i of the measure, and every name carries the namespace prefix.
Where:
- $g$: Epigraph variable of the square root of the kurtosis, $g \geq \lVert \boldsymbol{x}_{kt} \rVert_{2}$.
- $\boldsymbol{x}_{kt}$: Vector whose squared norm is the kurtosis expression. The exact formulation states $\mathbf{G}_{kt} \mathbf{L}_2 \mathrm{vec}(\mathbf{W})$, and the approximate formulation states entry $j$ as $\mathrm{Tr}(\mathbf{B}_j \mathbf{W})$.
- $\mathbf{W}$: Lifted weight matrix, symmetric $N \times N$.
set_sdp_constraints!bounds it by $\mathbf{W} \succeq \boldsymbol{w} \boldsymbol{w}^\intercal / k$. - $k$: Variable that scales the budget in the homogenised problem.
- $\mathcal{K}_{q} = \{(t, \boldsymbol{x}) : t \geq \lVert \boldsymbol{x} \rVert_{q}\}$: Norm cone of order $q$. $\mathcal{K}_{2}$ is the second-order cone.
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
Relaxation
The encoding is not exact: the entries below bound the quantity instead of reproducing it, and the bound is tight only under the condition stated here.
- $\lVert \boldsymbol{x}_{kt} \rVert_2^2 = \mathrm{vec}(\mathbf{W})^\intercal \mathbf{K} \mathrm{vec}(\mathbf{W})$. A sample cokurtosis is a mean of $(\boldsymbol{y}_t \otimes \boldsymbol{y}_t)(\boldsymbol{y}_t \otimes \boldsymbol{y}_t)^\intercal$ over centred observations $\boldsymbol{y}_t$, with non-negative weights. For such a matrix the expression is the mean of $(\boldsymbol{y}_t^\intercal \mathbf{W} \boldsymbol{y}_t)^2$, and $\mathbf{W} \succeq \boldsymbol{w} \boldsymbol{w}^\intercal / k$ gives $\boldsymbol{y}_t^\intercal \mathbf{W} \boldsymbol{y}_t \geq (\boldsymbol{y}_t^\intercal \boldsymbol{w})^2 / k$. So the expression lies at or above $m_4(\boldsymbol{w}) / k^2$.
kurtosis_risk_lies at or above $\lVert \boldsymbol{x}_{kt} \rVert_2$, so at or above $\sqrt{m_4(\boldsymbol{w})} / k$. It is tight at $\mathbf{W} = \boldsymbol{w} \boldsymbol{w}^\intercal / k$, which the objective reaches when it minimises the risk and no other row acts on $\mathbf{W}$.- A bound on
kurtosis_risk_is exact, because the weights satisfy it when $\sqrt{m_4(\boldsymbol{w})}$ is at most the bound.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::Kurtosis: The measure, read forkt,mtx_sqrt,algandsettings.opt::RiskConstraintOwner: The owner of the risk constraint, a risk-based JuMP optimisation estimator or a programme Allocation Set.pr::AbstractPriorResult: The prior result. It suppliesktwhen the measure states none.
Keyword arguments
prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).
Validation
r.ktorprholds a cokurtosis matrix.assert_high_order_quantityraises anArgumentErrorotherwise.- The projected matrix has a square root under
r.mtx_sqrt, asmatrix_square_rootstates. Raises aLinearAlgebra.PosDefException.
Returns
risk: The kurtosis risk expression ofset_kurtosis_risk!.
Related
Kurtosisget_chol_or_Gkt_pmset_kurtosis_risk!set_sdp_constraints!dup_elim_sum_selectorassert_high_order_quantity
References
- [66] D. Cajas. Convex Optimization of Portfolio Kurtosis. Available at SSRN 4202967 (2022). Section 2, Equation 6, and Section 3.1, Equation 13.
References
- [12]
- D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
- [66]
- D. Cajas. Convex Optimization of Portfolio Kurtosis. Available at SSRN 4202967 (2022).
- [195]
- D. Cajas. Approximation of Portfolio Kurtosis through Sum of Squared Quadratic Forms. Available at SSRN 4472793 (2023).