Delta Uncertainty Sets: private API

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

Builds the mean-axis delta box, which writes a width on the upper bound and zero on the lower one.

Neither bound is a bound on the mean. BoxUncertaintySet owns the rule: on this axis set_ucs_return_constraints! reads the pair only through its half-width $(\boldsymbol{u} - \boldsymbol{\ell}) / 2$ and centres that width on val, so a builder is free to put the whole width in $\boldsymbol{u}$, and this one does. The set the model sees is therefore $\hat{\boldsymbol{\mu}} \pm \delta_{\mu} \lvert \hat{\boldsymbol{\mu}} \rvert$, the $\delta_{\mu}$ of Equation 11.15. The zero lower bound is not a claim that the mean is non-negative, and abs fixes the width alone and never the centre: on $\hat{\mu}_i = -0.6$ with $\delta_{\mu} = 0.1$ the builder writes $\ell_i = 0$ and $u_i = 0.12$, and the model sees $[-0.66,\, -0.54]$, centred on the negative value. Its covariance-axis sibling 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 the builder writes.
  • $\hat{\boldsymbol{\mu}}$: Estimated mean vector.
  • $\delta_{\mu}$: Delta bound for expected returns.
  • $\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 and the consumer reads it once.
  2. Build ub, twice the half-width the model is to see, from dmu and the element-wise absolute value of pr.mu. The factor of two is what makes the half-width come out at $\delta_{\mu} \lvert \hat{\boldsymbol{\mu}} \rvert$.
  3. Build a BoxUncertaintySet from lb, ub and val = pr.mu, the characteristic vector the width is centred on.

Arguments

  • pr: Fitted prior. Only pr.mu is read.
  • dmu: Delta bound for expected returns. A dmu of zero writes lb == ub == 0, a half-width of zero, so the model's worst case collapses onto the nominal $\hat{\boldsymbol{\mu}}^{\intercal} \boldsymbol{w}$.

Returns

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

Related

References

  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Equation 11.15.
source
PortfolioOptimisers.sigma_delta_box_setFunction
sigma_delta_box_set(pr, dsigma::Number) -> BoxUncertaintySet

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

It is the other side of the rule BoxUncertaintySet owns. 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}$, so each bound enters on its own and neither is halved against the other. That route names no centre, so it never reads val, and its mean-axis sibling is mu_delta_box_set.

The map is element-wise, and it is not a scaling of the matrix: a positive entry of $\hat{\mathbf{\Sigma}}$ shrinks to $1 - \delta_{\sigma}$ of itself in $\mathbf{\Sigma}_{l}$, while a negative entry grows to $1 + \delta_{\sigma}$. The order $\mathbf{\Sigma}_{l} \leq \hat{\mathbf{\Sigma}} \leq \mathbf{\Sigma}_{u}$ therefore holds entry by entry at every $\delta_{\sigma}$, on a negative entry as much as on a positive one: $-0.2$ with $\delta_{\sigma} = 0.2$ gives $-0.24$ and $-0.16$. The cone order does not follow. This builder applies no posdef!, where its sampling sibling sigma_normal_box_set applies one to both bounds, so a large $\delta_{\sigma}$ leaves $\mathbf{\Sigma}_{l}$ indefinite. The consumer does not need it to be definite. It reads the two bounds entry by entry through the two traces above and factorises neither, so an indefinite lower bound builds, solves, and widens the worst case rather than breaking it. The library documents this rather than guarding it, so a $\delta_{\sigma}$ chosen far outside $(0, 1)$ is the caller's to justify.

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 for the covariance matrix.
  • $\hat{\mathbf{\Sigma}}$: Estimated covariance matrix.
  • $\delta_{\sigma}$: Delta bound for covariance.
  • $\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 everywhere, which is what orders the two bounds.
  2. Subtract d_sigma from pr.sigma, giving the lower bound. It is symmetric, because both operands are.
  3. Add d_sigma to pr.sigma, giving the upper bound.
  4. Build a BoxUncertaintySet from the two bounds and val = pr.sigma, the covariance they are calibrated on. The covariance route ignores val, which the mean route reads, so the field is carried for the reader rather than for this consumer.

Arguments

  • pr: Fitted prior. Only pr.sigma is read.
  • dsigma: Delta bound for covariance. A dsigma of zero writes lb == ub == pr.sigma, so the two traces collapse to $\operatorname{tr}(\mathbf{W} \hat{\mathbf{\Sigma}})$ and the model sees the nominal variance.

Returns

  • sigma_ucs::BoxUncertaintySet: The covariance-axis box, whose lb and ub are absolute bounds and whose val is pr.sigma.

Related

References

  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Equation 11.15.
source

References

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