Skip to content
18

Weight norm constraints

PortfolioOptimisers.set_weight_norm_2_constraints! Function
julia
set_weight_norm_2_constraints!(model::JuMP.Model, val::Number)
set_weight_norm_2_constraints!(args...)

Constrain the 2-norm of the weights, bounding the effective number of assets from below.

Diversification is expressed as a bound on a norm of the weight vector: the smaller the norm, the more evenly the weights spread across the assets. For the 2-norm the reciprocal of the squared norm is the effective number of assets, so bounding the norm above by k/val is the same as requiring at least val effective assets.

Mathematical definition

wn2w2,wn2valk.

Which, for a fully invested portfolio (k=1), is equivalent to:

ENA(w)=1w22val.

Where:

  • wn2: Auxiliary variable upper-bounding w2.

  • w: Portfolio weights vector N×1.

  • k: Budget scaling / homogenisation variable.

  • ENA(w): Effective number of assets.

  • val: Minimum required effective number of assets.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • val::Number: Minimum required effective number of assets.

Returns

  • nothing.

Details

  • val::Number: Introduces the auxiliary variable wn2, bounds it below by w2 with a SecondOrderCone constraint, and adds the linear constraint wn2 * sqrt(val) <= k.

  • args...: No-op, used when no 2-norm weight constraint is configured.

Related

source
PortfolioOptimisers.set_weight_norm_p_constraints! Function
julia
set_weight_norm_p_constraints!(model::JuMP.Model, lps::LpReg_VecLpReg)
set_weight_norm_p_constraints!(args...)

Constrain the p-norm of the weights, bounding the p-norm effective number of assets from below.

Generalises set_weight_norm_2_constraints! to an arbitrary norm order p>1. Each term supplies its own norm order and bound, so several may be imposed at once.

Each term is an LpRegularisation, reused here as a constraint rather than a penalty: its p field is the norm order, and its val field is the minimum p-norm effective number of assets, not the maximum norm. Larger val forces a more evenly spread portfolio.

Mathematical definition

tp,iwpi,tp,ivali1/pik.

Which, for a fully invested portfolio (k=1), is equivalent to:

ENApi(w)=1wpipivali.

Where:

  • tp,i: Auxiliary variable upper-bounding wpi.

  • pi: Norm order of the i-th term, its p field.

  • vali: Minimum required p-norm effective number of assets of the i-th term, its val field.

  • w: Portfolio weights vector N×1.

  • k: Budget scaling / homogenisation variable.

  • ENAp(w): Effective number of assets under the p-norm.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • lps::LpReg_VecLpReg: One or more p-norm weight constraints.

Returns

  • nothing.

Details

  • lps::LpReg_VecLpReg: For each term, introduces the auxiliary variables t_wnp_i and r_wnp_i, bounds wpi above by t_wnp_i with a set of MOI.PowerCone constraints, and adds the linear constraint t_wnp_i * val^(1 / p) <= k. Variables and constraints are suffixed by the term's index, so terms do not collide, and are named distinctly from those of set_lp_regularisation! so a model may carry both an Lp penalty and a p-norm constraint.

  • args...: No-op, used when no p-norm weight constraint is configured.

Related

source
PortfolioOptimisers.set_weight_norm_inf_constraints! Function
julia
set_weight_norm_inf_constraints!(model::JuMP.Model, linf::Number)
set_weight_norm_inf_constraints!(args...)

Constrain the ∞-norm of the weights, bounding the largest weight from above.

The limiting case of set_weight_norm_p_constraints!. linf is the reciprocal of the largest permitted weight, not the weight itself: a fully invested portfolio constrained with linf = 5 holds no position larger than 1 / 5, and so is spread across at least five assets. Larger linf forces a more evenly spread portfolio, consistent with the other members of the family.

Mathematical definition

tw,tlinfk.

Which, for a fully invested portfolio (k=1), is equivalent to:

maxi|wi|1linf.

Where:

  • t: Auxiliary variable upper-bounding w.

  • linf: Reciprocal of the largest permitted weight.

  • wi: Portfolio weight for asset i.

  • w: Portfolio weights vector N×1.

  • k: Budget scaling / homogenisation variable.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.

  • linf::Number: Reciprocal of the largest permitted weight.

Returns

  • nothing.

Details

  • linf::Number: Introduces the auxiliary variable t_wninf, bounds it below by w with a MOI.NormInfinityCone constraint, and adds the linear constraint t_wninf * linf <= k.

  • args...: No-op, used when no ∞-norm weight constraint is configured.

Related

source