Variance Skew Kurtosis Constraints
PortfolioOptimisers.set_risk_constraints! — Method
set_risk_constraints!(
model::Model,
i,
r::VarianceSkewKurtosis,
opt::Union{AbstractProgrammeAllocationSet, RiskJuMPOptimisationEstimator},
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> Any
Add the semidefinite relaxation of a VarianceSkewKurtosis to the model, and return its risk expression.
The model is Problem 12 of [219], with the budget homogenised by $k$. One positive semidefinite block, Equation 11 of that work, lifts the products of the weights into the matrices $\mathbf{W}_1$, $\mathbf{W}_2$ and $\mathbf{W}_3$, and each moment becomes a trace that is affine in a block. The block is built once for each namespace, so two measures of one model share it.
Any prior result is accepted. Both tensors must resolve, on their child or on the prior, and assert_high_order_quantity refuses the measure when either resolves on neither. The three vectorisation matrices come from dup_elim_sum_selector, so a container whose sk and kt children hold their own tensors builds against a LowOrderPrior, which carries the sigma that the third child needs.
Algorithm
- Check that
r.sk.skorprholds a coskewness matrix, and thatr.kt.ktorprholds a cokurtosis matrix, withassert_high_order_quantity. - Read
w, the weights,sc, the constraint scale, andk, the homogenisation variable. - Select
sigma,skandkt, the matrix of each child, else the matrix of the prior. - Read
D2,L2andS2for theNassets withdup_elim_sum_selector. - Build
W1,W2,W3,L2W1and the blockMonce for the namespace, and register the cone row below. - Register
vr_risk,sk_riskandkt_risk, the three traces. - Compute the bound of each term with
variance_risk_bounds_val. The bound ofktis the square ofkt.settings.ubunderSOCRiskExpr, because thatubis in the units of $\sqrt{m_4}$. - Bound each term with
set_variance_risk_bounds_and_expression!. The skewness bound is a floor, so its row has the opposite sign. The children holdrke = false, so no term entersrisk_vecalone. Recordr.vr,r.skandr.ktas the owners of the frontier entries of their terms withset_risk_frontier_owner!, so that a sweep on a term takes its span from that term.expected_riskvaluesr.skas the third moment of the coskewness matrix, the units ofsk.settings.lb, because that is the value of the functor ofSkewness. - Register
vr_sk_kt_risk, the weighted sum, bound it and add it torisk_vecwithset_risk_bounds_and_expression!, and return it.
JuMP formulation
Variables
w: read, $\boldsymbol{w}$.k: read, $k$.W1_vr_sk_kt: created, the symmetric $N \times N$ block $\mathbf{W}_1$, which stands for $\boldsymbol{w} \boldsymbol{w}^\intercal / k$.W2_vr_sk_kt: created, the $M \times N$ block $\mathbf{W}_2$, which stands for $\mathbf{L}_2 (\boldsymbol{w} \otimes \boldsymbol{w}) \boldsymbol{w}^\intercal / k^2$.W3_vr_sk_kt: created, the symmetric $M \times M$ block $\mathbf{W}_3$, which stands for $\mathbf{L}_2 (\boldsymbol{w} \otimes \boldsymbol{w}) (\boldsymbol{w} \otimes \boldsymbol{w})^\intercal \mathbf{L}_2^\intercal / k^3$.
Expressions
L2W1_vr_sk_kt: $\mathbf{L}_2 \mathrm{vec}(\mathbf{W}_1)$.M_vr_sk_kt: the block matrix $\mathbf{M}$ below.vr_risk_: $\mathrm{Tr}(\mathbf{\Sigma} \mathbf{W}_1)$.sk_risk_: $\mathrm{Tr}(\mathbf{M}_3 \mathbf{D}_2 \mathbf{W}_2)$.kt_risk_: $\mathrm{Tr}(\mathbf{S}_2 \mathbf{K} \mathbf{S}_2^\intercal \mathbf{W}_3)$.vr_sk_kt_risk_: $s_{\sigma^2} \mathrm{Tr}(\mathbf{\Sigma} \mathbf{W}_1) - s_{\mathrm{sk}} \mathrm{Tr}(\mathbf{M}_3 \mathbf{D}_2 \mathbf{W}_2) + s_{\kappa} \mathrm{Tr}(\mathbf{S}_2 \mathbf{K} \mathbf{S}_2^\intercal \mathbf{W}_3)$.
\[\begin{align} \mathbf{M} &= \begin{bmatrix} k & \boldsymbol{w}^\intercal & \left(\mathbf{L}_2 \mathrm{vec}(\mathbf{W}_1)\right)^\intercal \\ \boldsymbol{w} & \mathbf{W}_1 & \mathbf{W}_2^\intercal \\ \mathbf{L}_2 \mathrm{vec}(\mathbf{W}_1) & \mathbf{W}_2 & \mathbf{W}_3 \end{bmatrix}\,. \end{align}\]
Constraints
M_vr_sk_kt_PSD: $s_c \mathbf{M} \succeq 0$.vr_risk_<i>_ub: $s_c \left(\mathrm{Tr}(\mathbf{\Sigma} \mathbf{W}_1) - u_{\sigma^2} k\right) / |u_{\sigma^2}| \leq 0$, whenvr.settings.ubis a number.sk_risk_<i>_ub: $-s_c \left(\mathrm{Tr}(\mathbf{M}_3 \mathbf{D}_2 \mathbf{W}_2) - l_{\mathrm{sk}} k\right) / |l_{\mathrm{sk}}| \leq 0$, whensk.settings.lbis a number.kt_risk_<i>_ub: $s_c \left(\mathrm{Tr}(\mathbf{S}_2 \mathbf{K} \mathbf{S}_2^\intercal \mathbf{W}_3) - u_{\kappa} k\right) / |u_{\kappa}| \leq 0$, whenkt.settings.ubis a number.vr_sk_kt_risk_<i>_ub: the bound ofsettings.ubonvr_sk_kt_risk_, fromset_risk_bounds_and_expression!.
set_risk_upper_bound! registers the four bound rows. It divides each row by the bound_scale of its bound, the absolute value of the bound, or one for a zero bound, so the trace of the cokurtosis keeps coefficients of order one. A frontier in a bound replaces its row with the frontier variable of that function. Each name except those of the block carries the index i of the measure, and every name carries the namespace prefix.
Where:
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $k$: Variable that scales the budget in the homogenised problem.
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $M = N(N+1)/2$: Number of entries on and below the diagonal of an $N \times N$ matrix.
- $\mathbf{\Sigma}$: Covariance matrix of the risk measure, $N \times N$. It is the measure's own matrix when the measure states one, and the prior's otherwise.
- $\mathbf{M}_3$: Coskewness matrix of the risk measure, $N \times N^2$. It is the measure's own
skwhen the measure states one, and the prior's otherwise. - $\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{D}_2$: Duplication matrix, $N^2 \times N(N+1)/2$. For a symmetric $\mathbf{A}$, $\mathbf{D}_2 \mathbf{L}_2 \mathrm{vec}(\mathbf{A}) = \mathrm{vec}(\mathbf{A})$.
- $\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}$. - $s_{\sigma^2}$, $s_{\mathrm{sk}}$, $s_{\kappa}$: The
settings.scaleofvr,skandkt. - $u_{\sigma^2}$:
vr.settings.ub. - $l_{\mathrm{sk}}$:
sk.settings.lb. - $u_{\kappa}$:
kt.settings.ub, squared underSOCRiskExpr.
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.
- The corner $k$ of $\mathbf{M}$ gives $\mathbf{W}_1 \succeq \boldsymbol{w} \boldsymbol{w}^\intercal / k$, so
vr_risk_lies at or above $\boldsymbol{w}^\intercal \mathbf{\Sigma} \boldsymbol{w} / k$. - The same block gives $\mathbf{W}_3 \succeq \mathbf{L}_2 \mathrm{vec}(\mathbf{W}_1) \mathrm{vec}(\mathbf{W}_1)^\intercal \mathbf{L}_2^\intercal / k$. For a sample cokurtosis,
kt_risk_then lies at or above $m_4(\boldsymbol{w}) / k^3$, by the argument of the exact formulation ofKurtosis. - No row ties $\mathbf{W}_2$ to the weights, so
sk_risk_bounds $m_3(\boldsymbol{w}) / k^2$ in neither direction. The objective subtracts it, so a minimisation pushes it up, and a large $s_{\mathrm{sk}}$ moves it far from $m_3$. - So
vr_sk_kt_risk_bounds the value of the functor in neither direction. All four terms are exact when $\mathbf{M}$ has rank one, and Section 3 of [219] states that the relaxation is tight over a range of skewness values only. - The ceilings on
vr_risk_andkt_risk_hold the weights, because each term lies at or above its moment. The floor onsk_risk_holds the relaxation and not the weights, so the returned weights can have a third moment belowsk.settings.lb. - A
Frontiersweep binds the relaxation in the same way. The span of a sweep onsk.settings.lbis $m_3$ at the two corner portfolios, and the span of a sweep onsettings.ubis the value of the functor at the two corners. Each level is a correct value, but the floor onsk_risk_binds no weight, so a sweep on it can return one portfolio at every level. A sweep onsettings.ubmeets each level while the relaxation is tight. When a large $s_{\mathrm{sk}}$ opens the gap, the levels can return one portfolio, whose value of the functor lies far from its level.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::VarianceSkewKurtosis: Composite risk measure.opt::RiskConstraintOwner: The owner of the risk constraint, a risk-based JuMP optimisation estimator or a programme Allocation Set.pr::AbstractPriorResult: Prior result. It suppliessigma,skandktwhere the children state none.
Keyword arguments
prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).
Validation
r.sk.skorprholds a coskewness matrix, andr.kt.ktorprholds a cokurtosis matrix.assert_high_order_quantityraises anArgumentErrorotherwise.
Returns
vr_sk_kt_risk: The weighted sum of the three traces.
Related
VarianceSkewKurtosisset_variance_risk_bounds_and_expression!set_risk_bounds_and_expression!set_risk_upper_bound!variance_risk_bounds_valassert_high_order_quantitydup_elim_sum_selector
References
- [219] D. Cajas. Semidefinite Relaxation of Higher Portfolio Moments. Available at SSRN 5284483 (2025). Section 3, Equation 11 and Problems 12 to 14.
References
- [219]
- D. Cajas. Semidefinite Relaxation of Higher Portfolio Moments. Available at SSRN 5284483 (2025).