Tracking Risk Measure Constraints
PortfolioOptimisers.set_risk_constraints! Method
set_risk_constraints!(
model::Model,
i,
r::TrackingRiskMeasure{<:Any, <:Any, <:L1Tracking},
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> AnyAdd tracking risk constraints to model.
The L1Tracking overload uses an L1-norm cone. The L2Tracking / SquaredL2Tracking overload uses an SOC. The LpTracking overload uses power cones parameterised by r.alg.p. The LInfTracking overload uses an infinity-norm cone. The independent-variable overload shifts the weight vector by a benchmark before delegating to set_risk_tracking_risk_constraints!. The dependent-variable overload computes a benchmark risk and adds an L1-norm cone on the risk difference via set_risk_tracking_risk_constraints!.
Mathematical definition
Where:
: Tracking risk measure. : Return matrix . : Portfolio weights vector . : Benchmark return series. : Rebalancing factor (0 or 1). : Normalisation constant depending on the norm order .
where
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r: Tracking risk measure instance.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr::AbstractPriorResult: Prior result containing the returns matrixX.pl: Optional phylogeny constraints.fees: Optional fees structure.
Returns
nothing.
Related
sourcePortfolioOptimisers.set_risk_constraints! Method
set_risk_constraints!(
model::Model,
i,
r::TrackingRiskMeasure{<:Any, <:Any, <:Union{var"#s2413", var"#s2412"} where {var"#s2413"<:L2Tracking, var"#s2412"<:SquaredL2Tracking}},
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> AnyAdd JuMP risk constraints for TrackingRiskMeasure with L2Tracking or SquaredL2Tracking to model.
Introduces a scalar variable and an SOC constraint to encode the L2 (root mean squared) tracking error between portfolio and benchmark returns.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::TrackingRiskMeasure{<:Any, <:Any, <:Union{<:L2Tracking, <:SquaredL2Tracking}}: The tracking risk measure.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr: Prior result.
Returns
nothing.
Related
sourcePortfolioOptimisers.set_risk_constraints! Method
set_risk_constraints!(
model::Model,
i,
r::TrackingRiskMeasure{<:Any, <:Any, <:LpTracking},
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> AnyAdd JuMP risk constraints for TrackingRiskMeasure with LpTracking to model.
Introduces a scalar variable and power-cone constraints to encode the Lp-norm tracking error between portfolio and benchmark returns, scaled by (T - ddof)^(1/p).
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::TrackingRiskMeasure{<:Any, <:Any, <:LpTracking}: The tracking risk measure.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr: Prior result.
Returns
nothing.
Related
sourcePortfolioOptimisers.set_risk_constraints! Method
set_risk_constraints!(
model::Model,
i,
r::TrackingRiskMeasure{<:Any, <:Any, <:LInfTracking},
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> AnyAdd JuMP risk constraints for TrackingRiskMeasure with LInfTracking to model.
Introduces a scalar variable and an infinity-norm cone constraint to encode the L∞-norm (maximum) tracking error between portfolio and benchmark returns, scaled by T - ddof.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::TrackingRiskMeasure{<:Any, <:Any, <:LInfTracking}: The tracking risk measure.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr: Prior result.
Returns
nothing.
Related
sourcePortfolioOptimisers.set_risk_constraints! Method
set_risk_constraints!(
model::Model,
i,
r::RiskTrackingRiskMeasure{<:Any, <:Any, <:Any, <:IndependentVariableTracking},
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
pl::Union{Nothing, AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}},
fees::Union{Nothing, Fees},
args...;
prefix,
kwargs...
) -> AnyAdd JuMP risk constraints for RiskTrackingRiskMeasure with IndependentVariableTracking to model.
Stores the benchmark-shifted weights w - wb*k at Symbol(tprefix, :w) under the composed tracking prefix tprefix = Symbol(prefix, :tr_iv_, i, :_), delegates to set_risk_tracking_risk_constraints! to build the inner risk on those weights under tprefix, then applies risk bounds and expression registration. The prefix namespacing replaces the former save/restore swap (ADR 0005) and is re-entrant.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::RiskTrackingRiskMeasure{<:Any, <:Any, <:Any, <:IndependentVariableTracking}: The risk-tracking risk measure.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr: Prior result.pl: Optional phylogeny constraints.fees: Optional fees structure.
Returns
- The tracking risk JuMP expression.
Related
PortfolioOptimisers.set_risk_constraints! Method
set_risk_constraints!(
model::Model,
i,
r::RiskTrackingRiskMeasure{<:Any, <:Any, <:Any, <:DependentVariableTracking},
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
pl::Union{Nothing, AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}},
fees::Union{Nothing, Fees},
args...;
prefix,
kwargs...
) -> VariableRefAdd JuMP risk constraints for RiskTrackingRiskMeasure with DependentVariableTracking to model.
Computes the benchmark's expected risk value, stores the (unshifted) portfolio weights at Symbol(tprefix, :w) under the composed tracking prefix tprefix = Symbol(prefix, :tr_dv_, i, :_), delegates to set_risk_tracking_risk_constraints! to build the inner portfolio risk under tprefix, then adds an L1-norm cone constraint on the difference between the portfolio's risk expression and the benchmark's expected risk scaled by the allocation variable k. The prefix namespacing replaces the former save/restore swap (ADR 0005) and is re-entrant.
Arguments
model::JuMP.Model: The JuMP optimisation model.i: Constraint index for unique variable and constraint naming.r::RiskTrackingRiskMeasure{<:Any, <:Any, <:Any, <:DependentVariableTracking}: The risk-tracking risk measure.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr: Prior result.pl: Optional phylogeny constraints.fees: Optional fees structure.
Returns
- The tracking risk JuMP expression.
Related
PortfolioOptimisers.set_tracking_risk! Function
set_tracking_risk!(
model::Model,
r::TrackingRiskMeasure{<:Any, <:Any, <:L2Tracking},
opt::RiskJuMPOptimisationEstimator,
tracking_risk::AbstractJuMPScalar,
key::Symbol
) -> AbstractJuMPScalarFinalise the L2 or squared-L2 tracking risk expression and apply bounds.
The L2Tracking overload calls set_risk_bounds_and_expression! directly with the SOC variable. The SquaredL2Tracking overload squares it and applies a sqrt-converted upper bound to the original SOC variable.
Arguments
model::JuMP.Model: The JuMP optimisation model.r::TrackingRiskMeasure: Tracking risk measure instance.opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.tracking_risk::JuMP.AbstractJuMPScalar: Normalised tracking-risk SOC variable.key::Symbol: Symbol used to name constraints or expressions in the model.
Returns
nothing.
Related
sourcePortfolioOptimisers.set_risk_tr_constraints! Function
set_risk_tr_constraints!(
key,
model::Model,
r::RiskMeasure,
opt::JuMPOptimisationEstimator,
pr::AbstractPriorResult,
pl::Union{Nothing, AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}},
fees::Union{Nothing, Fees},
args...;
kwargs...
) -> AnyDispatch to indexed set_risk_constraints! for a single measure or iterate over a vector of measures, using a name prefix key for unique constraint naming.
Arguments
key: Name prefix for unique constraint symbols.model::JuMP.Model: The JuMP optimisation model.r: ARiskMeasureor a vector of risk measures.opt::JuMPOptimisationEstimator: JuMP optimisation estimator.pr: Prior result.pl: Optional phylogeny constraints.fees: Optional fees structure.
Returns
nothing.
Related
sourcePortfolioOptimisers.set_risk_tracking_risk_constraints! Function
set_risk_tracking_risk_constraints!(
model::Model,
r,
opt::RiskJuMPOptimisationEstimator,
pr::AbstractPriorResult,
pl::Union{Nothing, AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}},
fees::Union{Nothing, Fees},
tprefix::Symbol,
args...;
kwargs...
) -> AnyBuild the inner risk expression for risk tracking under a namespaced tprefix.
The caller stores the tracking-difference weights at Symbol(tprefix, :w), so the inner set_risk_tr_constraints! build reads and writes ALL of its shared model-state keys (:w, :net_X, :W, :variance_flag, …) under tprefix and cannot collide with the outer model's keys. This replaces the former save/unregister/restore swap (ADR 0005): the prefix isolates the nested build structurally. Because tracking prefixes COMPOSE (tprefix = Symbol(prefix, :tr_iv_, i, :_)), tracking-nested-in-tracking is collision-free.
Arguments
model::JuMP.Model: The JuMP optimisation model.r: Inner risk measure (or vector of measures).opt::RiskJuMPOptimisationEstimator: Risk-based optimisation estimator.pr: Prior result.pl: Optional phylogeny constraints.fees: Optional fees structure.tprefix::Symbol: Composed tracking prefix namespacing the nested build's keys.
Returns
- The inner risk JuMP expression.
Related
source<!– set_triv_risk_constraints! –> <!– set_trdv_risk_constraints! –>