Concentration Constraints: private API
PortfolioOptimisers.set_concentration_constraints! — Function
set_concentration_constraints!(model::JuMP.Model, conc::Nothing, args...; kwargs...)
set_concentration_constraints!(model::JuMP.Model, conc::Cnl_VecCnl,
wb::WeightBounds, ss::Option{<:Number};
prefix::Symbol = Symbol(""))Add the concentration rules of a block to the model.
The block builder set_block_constraints! calls it after the MIP kinds, so the parts of the weights exist. Rule i of the slot registers its entries under the keys conc_<name>_i, under prefix, so two rules and two blocks do not collide. The form of each rule, its field alg, picks its rows, see set_concentration_rows!. The rules of a vector intersect.
The rows follow the scale of the weights. A ratio objective and a RiskBudgeting head solve for the scaled weights $k \boldsymbol{w}$, so each number of a rule is multiplied by k, the variable of get_k, as the weight bounds multiply theirs. The binary of the exact form then gates the rows through the product z k that declare_mip_gate! declares, as the held bit does. When k is the number 1, the binary gates the rows directly.
Algorithm
conc = nothing: add no row.- For each rule
clat indexi:- Make the
ConcentrationMIPSpaceof the rule. - Make the positions
xwithmip_wx!, which registers them asconc_x_i. - Add the rows of the form
cl.algwithset_concentration_rows!.
- Make the
Arguments
model::JuMP.Model: The JuMP optimisation model.conc: The resolved rules of the block, ornothing.wb: The weight bounds of the block, which size the big-M expression under a free budget.ss::Option{<:Number}: Big-M scaling constant (computed viaget_mip_sswhennothing).prefix::Symbol = Symbol(""): Model State namespace of the call. The builder reads the weights under it, and every entry that it registers takes it, so two calls under two prefixes add two sets of rows to one model. The empty default gives the bare names.
Returns
nothing.
Related