Brownian Distance Variance Constraints: private API

PortfolioOptimisers.set_brownian_distance_variance_constraints! — Function
set_brownian_distance_variance_constraints!(
    model::Model,
    ::NormOneConeBrownianDistanceVariance,
    Dt::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
    Dx::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}};
    prefix
)

Add the rows that bound each entry of the distance matrix Dt from below by the absolute value of the matching entry of Dx.

The formulation selects the rows. Both methods state the same feasible set, $D_{ij} \geq |\Delta_{ij}|$ for every pair of observations, so both give the same optimum. NormOneConeBrownianDistanceVariance adds one cone of dimension two for each entry on or below the diagonal. IneqBrownianDistanceVariance adds two matrix rows of $T^2$ linear inequalities each. Dx is antisymmetric and Dt is symmetric, so the entry $(j, i)$ of each matrix row repeats the entry $(i, j)$ of the other.

JuMP formulation

Variables

  • Dt: read, the symmetric matrix $\mathbf{D}$.

Constraints

Each name carries the namespace prefix.

Where:

  • $\mathbf{D}$: Symmetric $T \times T$ matrix variable of the distances between the portfolio returns, with entries $D_{ij}$.
  • $\boldsymbol{\Delta}$: The expression Dx, the $T \times T$ matrix of the differences $\Delta_{ij} = \hat{r}_i - \hat{r}_j$ of the net portfolio returns $\hat{r}_i$ in net_X.
  • $T$: Number of observations.
  • $\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.

  • The rows bound $D_{ij}$ from below by $|\Delta_{ij}|$, so $\mathbf{D}$ is the distance matrix of net_X only when every row is tight.
  • The risk expression of set_brownian_distance_risk_constraint! increases in each entry of a non-negative $\mathbf{D}$. So the rows are tight when the objective minimises the risk.
  • Under a bound on the risk and an objective that does not minimise it, an entry of $\mathbf{D}$ can exceed $|\Delta_{ij}|$. The risk at the true distance matrix is then at or below the risk at $\mathbf{D}$, so the bound still holds the value of the functor of BrownianDistanceVariance.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.
  • ::BrownianDistanceVarianceFormulation: The formulation, which selects the rows.
  • Dt::MatNum: $\mathbf{D}$.
  • Dx::MatNum: $\boldsymbol{\Delta}$.

Keyword arguments

  • prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_brownian_distance_risk_constraint! — Function
set_brownian_distance_risk_constraint!(
    model::Model,
    ::QuadRiskExpr,
    Dt::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
    iT2::Number;
    prefix
) -> Any

Register the risk expression of BrownianDistanceVariance over the distance matrix Dt, and return it.

The expression is equation 9 of [215], the disciplined-convex upper bound on the distance variance that the docstring of BrownianDistanceVariance derives. QuadRiskExpr states it as a quadratic form in Dt. RSOCRiskExpr holds each of its two squares with a rotated second-order cone, so the expression is affine in the variables and a bound on the risk is a conic row.

JuMP formulation

Variables

  • Dt: read, the symmetric matrix $\mathbf{D}$.
  • tDt: created under RSOCRiskExpr, the scalar $t$.
  • tsum_Dt: created under RSOCRiskExpr, the scalar $u$.

Expressions

  • bdvariance_risk: $\frac{1}{T^2} \left( \lVert \mathbf{D} \rVert_F^2 + \frac{1}{T^2} \left( \boldsymbol{1}^\intercal \mathbf{D} \boldsymbol{1} \right)^2 \right)$ under QuadRiskExpr, and $\frac{1}{T^2} (t + u)$ under RSOCRiskExpr.

Constraints

  • rsoc_Dt: under RSOCRiskExpr, $(s_c t,\, s_c / 2,\, s_c \operatorname{vec}(\mathbf{D})) \in \mathcal{K}_{r}$, which is $t \geq \lVert \mathbf{D} \rVert_F^2$.
  • rsoc_sum_Dt: under RSOCRiskExpr, $(s_c u,\, s_c / 2,\, s_c \boldsymbol{1}^\intercal \mathbf{D} \boldsymbol{1} / T) \in \mathcal{K}_{r}$, which is $u \geq \left( \boldsymbol{1}^\intercal \mathbf{D} \boldsymbol{1} / T \right)^2$. The factor $1 / T$ keeps $u$ of the size of $t$, so both reach the same relative accuracy in the solver.

Each name carries the namespace prefix.

Where:

  • $\mathbf{D}$: Symmetric $T \times T$ matrix variable of the distances between the portfolio returns.
  • $T$: Number of observations.
  • $\boldsymbol{1}$: Column vector of ones, $T \times 1$.
  • $\lVert \cdot \rVert_F$: Frobenius norm.
  • $t$, $u$: Epigraph variables of the two squares.
  • $\mathcal{K}_{r} = \{(a, b, \boldsymbol{x}) : 2 a b \geq \lVert \boldsymbol{x} \rVert_2^2,\, a \geq 0,\, b \geq 0\}$: Rotated second-order cone. The model states it with a JuMP.RotatedSecondOrderCone.
  • $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.

  • bdvariance_risk lies at or above the distance variance $\frac{1}{T^2} \lVert \mathbf{C}_T \mathbf{D} \mathbf{C}_T \rVert_F^2$ of $\mathbf{D}$, with $\mathbf{C}_T$ the centring matrix. The gap is $\frac{2}{T^3} \lVert \mathbf{D} \boldsymbol{1} \rVert_2^2$, which is zero only when every entry of $\mathbf{D}$ is zero, that is, for a constant series of portfolio returns. On Gaussian returns at $T = 50$ the bound is 6.9 times the distance variance.
  • Under QuadRiskExpr bdvariance_risk is exact in $\mathbf{D}$.
  • Under RSOCRiskExpr $t$ and $u$ lie at or above their squares, so bdvariance_risk lies at or above the expression of QuadRiskExpr. Both are tight when the objective minimises the risk.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.
  • ::QuadRiskExpr or ::RSOCRiskExpr: The risk expression formulation.
  • Dt::MatNum: $\mathbf{D}$.
  • iT2::Number: $1 / T^2$.

Keyword arguments

  • prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).

Returns

  • bdvariance_risk: The risk expression.

Related

source
PortfolioOptimisers.set_brownian_distance_bounds_expr! — Function
set_brownian_distance_bounds_expr!(model::JuMP.Model, ::Nothing, bdvariance_risk; prefix::Symbol = Symbol("")) -> bdvariance_risk
set_brownian_distance_bounds_expr!(model::JuMP.Model, ::RkRtBounds, bdvariance_risk; prefix::Symbol = Symbol("")) -> bdvariance_dev

Return the expression that the bound of a BrownianDistanceVariance acts on, and build it when the measure has a bound.

Without a bound, the method returns the risk expression and builds nothing. With a bound, it adds the square root of the risk expression to model and returns it. Both formulations of the risk expression state the same quantity, a sum of squares of the distances and of their sum. Its square root is the norm of one vector, so a second-order cone bounds it. The deviation has degree one in the weights and $k$, and the bound of the measure acts on it. The bound must be in the units of a deviation, as variance_risk_bounds_val gives it.

Mathematical definition

\[\begin{align} \mathrm{BDVar}(\mathbf{D}) &= \frac{1}{T^2} \sum_{i, j} D_{ij}^2 + \frac{1}{T^4} \left(\sum_{i, j} D_{ij}\right)^2 = \left\lVert \begin{bmatrix} \frac{1}{T} \operatorname{vec}(\mathbf{D}) \\ \frac{1}{T^2} \sum_{i, j} D_{ij} \end{bmatrix} \right\rVert_2^2\,. \end{align}\]

Where:

  • $\mathrm{BDVar}(\mathbf{D})$: The risk expression at the distance matrix $\mathbf{D}$.
  • $\mathbf{D}$: Symmetric matrix variable of the distances between the portfolio returns.
  • $T$: Number of observations.

JuMP formulation

Variables

  • bdvariance_dev: $\sigma_{\mathrm{BD}}$, the deviation.

Constraints

  • cbdvariance_dev_soc: $\left(s_c \sigma_{\mathrm{BD}}, \frac{s_c}{T} \operatorname{vec}(\mathbf{D}), \frac{s_c}{T^2} \sum_{i, j} D_{ij}\right) \in \mathcal{K}_{2}$, which is $\sigma_{\mathrm{BD}} \geq \sqrt{\mathrm{BDVar}(\mathbf{D})}$.

Each name carries the namespace prefix.

Where:

  • $\sigma_{\mathrm{BD}}$: The deviation variable.
  • $\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.

  • bdvariance_dev lies at or above $\sqrt{\mathrm{BDVar}(\mathbf{D})}$. A bound on it is exact, because the weights satisfy it when the square root of their risk expression is at most the bound.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.
  • ub: The bound in the units of a deviation, or nothing. The method reads only its type.
  • bdvariance_risk: The risk expression.

Keyword arguments

  • prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).

Returns

  • bdvariance_risk without a bound.
  • bdvariance_dev with a bound: the deviation variable. A second call with the same prefix returns the registered variable.

Related

source

References

[215]
D. Cajas. Portfolio Optimization of Brownian Distance Variance. Available at SSRN 4561293 (2023).