Regularisation Constraints
PortfolioOptimisers.LpRegularisation — Type
struct LpRegularisation{__T_p, __T_val} <: AbstractRegularisationEstimatorLp-norm penalty term that a JuMPOptimiser adds to the objective, or a ceiling on the Lp norm of the weights.
For $p > 1$ and a budget of one, Hölder's inequality gives $\lVert \boldsymbol{w} \rVert_p \geq N^{1/p - 1}$, with equality at equal weights alone. So the penalty moves weight away from concentrated positions. A larger $p$ puts more of the price on the largest weights.
In the lp field of JuMPOptimiser the term is a penalty, and val is the coefficient of the norm. In the lpc field it is a constraint, and val is a ceiling on the norm. The norm order p has one meaning in both fields. set_lp_regularisation! builds the penalty, and set_weight_norm_p_constraints! builds the constraint.
Mathematical definition
\[\begin{align} \text{penalty} &= \lambda_p \lVert \boldsymbol{w} \rVert_p\,. \end{align}\]
Where:
- $\lambda_p$: Lp penalty coefficient, the
valfield of anLpRegularisationin thelpfield ofJuMPOptimiser. - $p$: Norm order.
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
Fields
p: Norm order,p > 1.
val: Penalty coefficient when the estimator is used as a regularisation term (thelpfield ofJuMPOptimiser), or the upper bound on the p-norm of the weights when it is used as a norm constraint (thelpcfield). As a regularisation term it is the ambiguity radius of a type-$q$ Wasserstein ground metric with $1/p + 1/q = 1$. As a norm constraint it is a ceiling, which is a different quantity. One field therefore carries two readings, so the bound isNum_AmbRadNormCeilCal, which admits both rule families, and each of the two routes refuses the family that has no reading on it. It is the one slot that admits no plain function, because a function names no family and the two routes read the family.
Constructors
LpRegularisation(; p::Number = 3, val::Num_AmbRadNormCeilCal = 1e-3) -> LpRegularisationKeywords correspond to the struct's fields.
Validation
isfinite(p).p > 1.- If
valis a number:val > 0and finite. - The role in
valis checked by the field that holds the term, not here.valis the one dual-use slot in the library, so this constructor cannot know which reading applies:JuMPOptimiser's constructor refuses a norm-ceiling role inlpand a radius role inlpc, and the twofactoryroutes refuse the same pairings again.
Related
AbstractRegularisationEstimatorLpReg_VecLpRegVecLpRegNum_AmbRadNormCeilCalassert_penalty_coefficient_roleassert_norm_ceiling_roleset_lp_regularisation!set_weight_norm_p_constraints!L2Regularisation
References
- [240] V. DeMiguel, L. Garlappi, F. J. Nogales and R. Uppal. A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms. Management Science 55, 798–812 (2009). Pages 798-812. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
PortfolioOptimisers.L2Regularisation — Type
struct L2Regularisation{__T_val, __T_alg} <: AbstractRegularisationEstimatorL2-norm penalty term that a JuMPOptimiser adds to the objective.
The penalty shrinks the weights towards zero, and under a budget it spreads them over the assets. The alg field selects the formulation, which sets the cones the solver sees and the power of the norm, so one val gives a different penalty under each formulation. Under MaximumRatio the model's weights are the homogenised vector $k \boldsymbol{w}$, and $k$ scales with the normalisation ohf of the ratio. Each formulation gives a penalty of degree one in $k$: the squared formulations divide $\lVert k \boldsymbol{w} \rVert_2^2$ by $k$, through squared_norm_over_k!. When the ratio bounds the risk and maximises the return, the weights do not depend on ohf. When the ratio fixes the return and minimises the risk, they do not depend on ohf if the risk term also has degree one, as a standard deviation or a conditional value at risk has. A Variance in the SOC or quadratic formulation has degree two, so beside it the strength of every penalty changes with ohf.
Mathematical definition
\[\begin{align} \text{penalty} &= \lambda_2 \lVert \boldsymbol{w} \rVert_2^{q}\,. \end{align}\]
Where:
- $\lambda_2$: L2 penalty coefficient, the
valfield of anL2Regularisation. - $q$: Power of the L2 norm that the formulation penalises. It is $1$ under
SOCRiskExpr, and $2$ underSquaredSOCRiskExpr,QuadRiskExprandRSOCRiskExpr. - $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
Fields
val: L2 regularisation penalty coefficient. It is the ambiguity radius of a type-2 Wasserstein ground metric, so the bound isNum_AmbRadCaland the slot takes anAbstractAmbiguityRadiusCalibrationAlgorithmthat computes it from the prior result, or a plain function of the same five arguments. That reading holds only for the un-squared penalty ofSOCRiskExpr, soassert_ambiguity_radius_formulationrefuses a rule beside a squared formulation.
alg: Second-moment formulation used to express the L2 penalty.
Constructors
L2Regularisation(; val::Num_AmbRadCal = 1e-4, alg::SecondMomentFormulation = SOCRiskExpr()) -> L2RegularisationKeywords correspond to the struct's fields.
Validation
- If
valis a number:val > 0and finite. - If
valholds an ambiguity-radius rule:algmust beSOCRiskExpr.
Related
AbstractRegularisationEstimatorNum_AmbRadCalassert_ambiguity_radius_formulationL2Reg_VecL2RegVecL2RegSecondMomentFormulationset_l2_regularisation!_set_l2_regularisation!LpRegularisation
References
- [240] V. DeMiguel, L. Garlappi, F. J. Nogales and R. Uppal. A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms. Management Science 55, 798–812 (2009). Pages 798-812. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
PortfolioOptimisers.factory — Function
factory(
x::LpRegularisation,
pr::AbstractPriorResult
) -> LpRegularisation
factory(
x::LpRegularisation,
pr::AbstractPriorResult,
slv
) -> LpRegularisation
Resolve the ambiguity radius in val against prior result pr, and return an LpRegularisation holding the number.
It reads the slot as factory on L2Regularisation does. The estimator has no formulation slot, and val multiplies norm(w, p) and never its square, so assert_ambiguity_radius_formulation has nothing to refuse here.
In the lpc field of JuMPOptimiser the same estimator is a norm constraint, and val is a ceiling. The field decides the reading. This method refuses a norm-ceiling rule through assert_penalty_coefficient_role, and norm_ceiling_factory refuses a radius rule on the constraint side.
The slot resolves under the key :lpreg_val, which L2Regularisation does not use, because the two coefficients belong to two different ground metrics. The key names no norm order: p is a field of the term, and one rule can stand in several terms. So the method states the order of the term in the CalibrationContext, and DualNormRadius reads it there.
Algorithm
- Refuse a norm-ceiling rule in
x.valthroughassert_penalty_coefficient_role. - Resolve the slot
x.valunder the key:lpreg_valagainstpr, its observation weightspr.w,slvand aCalibrationContextthat holdsx.p, givingval. - Pair the declaration of
calibration_slotswith this resolver throughassert_declared_calibration_resolver. valis the object thatxalready holds: returnx. Otherwise rebuild the term through the keyword constructor withx.pandval.
Arguments
x: The regularisation term.pr: Prior result the rule reads.slv: Effective solver, ornothing.
Returns
LpRegularisation: The term, withvalholding a number.
Related
PortfolioOptimisers.factory — Function
factory(
x::L2Regularisation,
pr::AbstractPriorResult
) -> L2Regularisation
factory(
x::L2Regularisation,
pr::AbstractPriorResult,
slv
) -> L2Regularisation
Resolve the ambiguity radius in val against prior result pr, and return an L2Regularisation holding the number.
The stage 2 of the constraint block, resolve_constraint_block, calls it with the prior result of the block and the solver of its owner, before the library builds the model. The estimator is not @propagatable, so this method is the ordinary factory verb and not the generated one. The rebuild goes through the keyword constructor, so the positivity check and assert_ambiguity_radius_formulation run again on the resolved number.
The weights-only factory(l2, w) and port_opt_view return the estimator unchanged. Neither holds a prior result, so neither can resolve a rule. A rule that stays after a cluster slice is resolved against the prior of that cluster when resolve_constraint_block resolves the block of the cluster.
The slot resolves under the key :l2reg_val and not :val, because LpRegularisation also names its coefficient val, and the two coefficients belong to two different ground metrics. DualNormRadius reads the key to tell the type-2 metric of this penalty from the type-$q$ metric of the Lp penalty.
Algorithm
- Resolve the slot
x.valunder the key:l2reg_valagainstpr, its observation weightspr.wandslv, givingval. - Pair the declaration of
calibration_slotswith this resolver throughassert_declared_calibration_resolver. valis the object thatxalready holds: returnx. Otherwise rebuild the term through the keyword constructor withvalandx.alg.
Arguments
x: The regularisation term.pr: Prior result the rule reads.slv: Effective solver, ornothing.
Returns
L2Regularisation: The term, withvalholding a number.
Related
References
- [240]
- V. DeMiguel, L. Garlappi, F. J. Nogales and R. Uppal. A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms. Management Science 55, 798–812 (2009).