Regularisation Constraints

PortfolioOptimisers.LpRegularisation — Type
struct LpRegularisation{__T_p, __T_val} <: AbstractRegularisationEstimator

Lp-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 val field of an LpRegularisation in the lp field of JuMPOptimiser.
  • $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 (the lp field of JuMPOptimiser), or the upper bound on the p-norm of the weights when it is used as a norm constraint (the lpc field). 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 is Num_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) -> LpRegularisation

Keywords correspond to the struct's fields.

Validation

  • isfinite(p).
  • p > 1.
  • If val is a number: val > 0 and finite.
  • The role in val is checked by the field that holds the term, not here. val is the one dual-use slot in the library, so this constructor cannot know which reading applies: JuMPOptimiser's constructor refuses a norm-ceiling role in lp and a radius role in lpc, and the two factory routes refuse the same pairings again.

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). Pages 798-812. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source
PortfolioOptimisers.L2Regularisation — Type
struct L2Regularisation{__T_val, __T_alg} <: AbstractRegularisationEstimator

L2-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:

Fields

  • alg: Second-moment formulation used to express the L2 penalty.

Constructors

L2Regularisation(;    val::Num_AmbRadCal = 1e-4,    alg::SecondMomentFormulation = SOCRiskExpr()) -> L2Regularisation

Keywords correspond to the struct's fields.

Validation

  • If val is a number: val > 0 and finite.
  • If val holds an ambiguity-radius rule: alg must be SOCRiskExpr.

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). Pages 798-812. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source
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

  1. Refuse a norm-ceiling rule in x.val through assert_penalty_coefficient_role.
  2. Resolve the slot x.val under the key :lpreg_val against pr, its observation weights pr.w, slv and a CalibrationContext that holds x.p, giving val.
  3. Pair the declaration of calibration_slots with this resolver through assert_declared_calibration_resolver.
  4. val is the object that x already holds: return x. Otherwise rebuild the term through the keyword constructor with x.p and val.

Arguments

  • x: The regularisation term.
  • pr: Prior result the rule reads.
  • slv: Effective solver, or nothing.

Returns

  • LpRegularisation: The term, with val holding a number.

Related

source
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

  1. Resolve the slot x.val under the key :l2reg_val against pr, its observation weights pr.w and slv, giving val.
  2. Pair the declaration of calibration_slots with this resolver through assert_declared_calibration_resolver.
  3. val is the object that x already holds: return x. Otherwise rebuild the term through the keyword constructor with val and x.alg.

Arguments

  • x: The regularisation term.
  • pr: Prior result the rule reads.
  • slv: Effective solver, or nothing.

Returns

  • L2Regularisation: The term, with val holding a number.

Related

source

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).