Tracking Error Constraints: private API
PortfolioOptimisers.set_tracking_error_constraints! — Function
set_tracking_error_constraints!(args...; kwargs...)
Add tracking error constraints to the JuMP optimisation model.
The fall-through method does nothing. Concrete methods dispatch on the tracking algorithm type:
L1Norm: Enforces‖net_X - wb * k‖₁ ≤ err * Tvia NormOneCone.L2Norm: Enforces a scaled L2 norm via SecondOrderCone.SquaredL2Norm: The same cone, with the bound square-rooted, becauseerrbounds the squared error thatnorm_errorreports.LpNorm: Enforces a scaled Lp norm via power cone.LInfNorm: Enforces‖net_X - wb * k‖_∞ ≤ err * scalevia NormInfinityCone.IndependentVariableTracking: Substitutesw - wbforwand applies the chosen risk constraint.DependentVariableTracking: Constrains the absolute difference between portfolio risk and benchmark risk.
The collection method iterates over all tracking errors in tres.
Mathematical definition
\[\begin{align} t_{te} &\geq \lVert \mathbf{X}\boldsymbol{w} - \boldsymbol{b} k \rVert_p \cdot c_p^{-1}\,, \\ t_{te} &\leq \mathrm{err} \cdot k\,. \end{align}\]
Where:
- $t_{te}$: Auxiliary tracking error scalar variable.
- $\mathbf{X}$: Asset returns matrix ($T \times N$).
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $\boldsymbol{b}$: Benchmark return vector.
- $k$: Budget scaling / homogenisation variable.
- $p$: Norm order.
- $c_p$: Norm-specific scaling factor ($T$, $\sqrt{T - d}$, etc.).
- $\mathrm{err}$: Tracking error tolerance.
Arguments
model::JuMP.Model: The JuMP optimisation model.i::Integer: Constraint index for generating unique variable and constraint names.pr::AbstractPriorResult: Prior result providing the return matrixX.tr: Tracking error specification.opt: Optimisation estimator (required for risk-based tracking variants).pl: Optional phylogeny constraints.fees: Optional fees structure.
Returns
nothing.
Related
PortfolioOptimisers.tracking_error_soc_factor — Function
tracking_error_soc_factor(
f::L2Norm,
err::Number,
T::Integer
) -> Any
Convert a TrackingError tolerance into the bound on the second-order cone variable.
Both norms share one cone, which bounds $\lVert \mathbf{X}\boldsymbol{w} - \boldsymbol{b}k \rVert_2$. They do not share the quantity that err bounds. norm_error divides that norm by $\sqrt{T - d}$ for an L2Norm and squares it before dividing by $T - d$ for a SquaredL2Norm, so the second bound is square-rooted here to keep the model, the functor and set_risk_constraints! in agreement.
Arguments
f: TheNormErrorthe tracking error carries.err::Number: Tracking error tolerance.T::Integer: Number of observations.
Returns
f::Number: Upper bound on the cone variable, before the budget scaling by $k$.
Related