Delta Uncertainty Sets: private API

PortfolioOptimisers.mu_delta_box_set — Function
mu_delta_box_set(pr, dmu::Number) -> BoxUncertaintySet

Builds the delta box of the mean axis, which writes a width in the upper bound and zero in the lower bound.

Neither bound is a bound on the mean. BoxUncertaintySet states the rule. On this axis, set_ucs_return_constraints! reads only the half-width $(\boldsymbol{u} - \boldsymbol{\ell}) / 2$ of the pair, and it centres that width on val. This lets a builder put the full width in $\boldsymbol{u}$, and this builder does that. The model sees the set $\hat{\boldsymbol{\mu}} \pm \delta_{\mu} \lvert \hat{\boldsymbol{\mu}} \rvert$, with the $\delta_{\mu}$ of Equation 11.15.

The zero lower bound does not state that the mean is non-negative. abs sets the width, and it never moves the centre. For $\hat{\mu}_i = -0.6$ and $\delta_{\mu} = 0.1$, the builder writes $\ell_i = 0$ and $u_i = 0.12$. The model then sees $[-0.66,\, -0.54]$, whose centre is the negative value. The builder of the covariance axis, sigma_delta_box_set, is on the other side of the same rule.

Mathematical definition

\[\begin{align} \boldsymbol{\ell} &= \boldsymbol{0}\,, \\ \boldsymbol{u} &= 2 \delta_{\mu} \lvert \hat{\boldsymbol{\mu}} \rvert\,. \end{align}\]

Where:

  • $\boldsymbol{\ell}$, $\boldsymbol{u}$: Lower and upper bounds that the builder writes.
  • $\hat{\boldsymbol{\mu}}$: Estimated mean vector.
  • $\delta_{\mu}$: Fraction of the absolute mean that sets the half-width of the mean box.
  • $\lvert \cdot \rvert$: Element-wise absolute value.

Algorithm

  1. Build lb, a range of length(pr.mu) zeros of the element type of pr.mu. It is a range and not a vector, because every entry holds the same value.
  2. Build ub from dmu and the element-wise absolute value of pr.mu. It holds twice the half-width that the model sees, so the half-width is $\delta_{\mu} \lvert \hat{\boldsymbol{\mu}} \rvert$.
  3. Build a BoxUncertaintySet from lb, ub and val = pr.mu. val is the centre of the width.

Arguments

  • pr: Prior Result. The builder reads only pr.mu.
  • dmu: Fraction of the absolute mean that sets the half-width. A dmu of zero writes lb == ub == 0. The half-width is then zero, and the worst case of the model is the nominal $\hat{\boldsymbol{\mu}}^{\intercal} \boldsymbol{w}$.

Returns

  • mu_ucs::BoxUncertaintySet: Box of the mean axis. Its lb is a range of zeros, its ub holds twice the half-width, and its val is pr.mu.

Related

References

  • [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Equation 11.15. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source
PortfolioOptimisers.sigma_delta_box_set — Function
sigma_delta_box_set(pr, dsigma::Number) -> BoxUncertaintySet

Builds the delta box of the covariance axis, which writes absolute bounds. Both bounds bind in the model.

The builder is on the other side of the rule that BoxUncertaintySet states. On this axis, set_ucs_variance_risk! reads $\operatorname{tr}(\mathbf{A}_{u} \mathbf{\Sigma}_{u}) - \operatorname{tr}(\mathbf{A}_{l} \mathbf{\Sigma}_{l})$ under $\mathbf{A}_{u},\, \mathbf{A}_{l} \geq 0$ and $\mathbf{A}_{u} - \mathbf{A}_{l} = \mathbf{W}$. Each bound enters the expression alone, and the consumer does not halve one bound against the other. This route has no centre, so it never reads val. The builder of the mean axis is mu_delta_box_set.

The map is element-wise, and it does not scale the matrix. A positive entry of $\hat{\mathbf{\Sigma}}$ becomes $1 - \delta_{\sigma}$ times its value in $\mathbf{\Sigma}_{l}$. A negative entry becomes $1 + \delta_{\sigma}$ times its value. So the order $\mathbf{\Sigma}_{l} \leq \hat{\mathbf{\Sigma}} \leq \mathbf{\Sigma}_{u}$ holds entry by entry at every $\delta_{\sigma}$, for negative and positive entries. For example, $-0.2$ with $\delta_{\sigma} = 0.2$ gives $-0.24$ and $-0.16$.

The order of the positive semidefinite cone does not follow. This builder applies no posdef!, but sigma_normal_box_set, the builder of the normal box, applies posdef! to both bounds. A large $\delta_{\sigma}$ can make $\mathbf{\Sigma}_{l}$ indefinite. The consumer does not need a definite bound. It reads the two bounds entry by entry through the two traces, and it factorises neither bound. An indefinite lower bound builds and solves, and it makes the worst case larger.

The library documents this, and it adds no guard. A caller who sets $\delta_{\sigma}$ far outside $(0, 1)$ must justify the value.

Mathematical definition

\[\begin{align} \mathbf{\Sigma}_{l} &= \hat{\mathbf{\Sigma}} - \delta_{\sigma} \lvert \hat{\mathbf{\Sigma}} \rvert\,, \\ \mathbf{\Sigma}_{u} &= \hat{\mathbf{\Sigma}} + \delta_{\sigma} \lvert \hat{\mathbf{\Sigma}} \rvert\,. \end{align}\]

Where:

  • $\mathbf{\Sigma}_{l}$, $\mathbf{\Sigma}_{u}$: Lower and upper bounds of the covariance matrix.
  • $\hat{\mathbf{\Sigma}}$: Estimated covariance matrix.
  • $\delta_{\sigma}$: Fraction of the absolute covariance that sets the half-width of the covariance box.
  • $\lvert \cdot \rvert$: Element-wise absolute value.

Algorithm

  1. Build d_sigma, the element-wise half-width, from dsigma and the element-wise absolute value of pr.sigma. It is non-negative at every entry, and this puts the two bounds in order.
  2. Subtract d_sigma from pr.sigma to get the lower bound. The lower bound is symmetric, because both operands are symmetric.
  3. Add d_sigma to pr.sigma to get the upper bound.
  4. Build a BoxUncertaintySet from the two bounds and val = pr.sigma, the covariance at the centre of the bounds. The mean route reads val, but the covariance route does not. On this axis, the field holds the centre for a reader of the result.

Arguments

  • pr: Prior Result. The builder reads only pr.sigma.
  • dsigma: Fraction of the absolute covariance that sets the half-width. A dsigma of zero writes lb == ub == pr.sigma. The two traces then become $\operatorname{tr}(\mathbf{W} \hat{\mathbf{\Sigma}})$, and the model sees the nominal variance.

Returns

  • sigma_ucs::BoxUncertaintySet: Box of the covariance axis. Its lb and ub are absolute bounds, and its val is pr.sigma.

Related

References

  • [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Equation 11.15. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source

References

[12]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).