liveBook · Manning

Relative weight constraint

As explained in Build a Robo-Advisor with Python (From Scratch)

A relative weight constraint limits how far the weights of two or more assets may differ in ratio or absolute amount.

A relative weight constraint keeps two or more portfolio weights within a chosen ratio or difference. It preserves approximate allocation relationships while allowing optimization to adjust exposures. section 10.2.2

Global equity allocation

For US, foreign developed, and emerging equities weighted approximately 60%, 30%, and 10%, the US-to-emerging ratio is 6. A portfolio constraint might permit ratios from 3 to 12, or half to twice the reference ratio. section 10.2.2

Use either of these formulations:

  • Ratio bounds: lᵢⱼ ≤ wᵢ/wⱼ ≤ uᵢⱼ, implemented under nonnegative weights as lᵢⱼwⱼ ≤ wᵢ ≤ uᵢⱼwⱼ. section 10.2.2
  • Difference bounds: constrain wᵢ − wⱼ between lower and upper limits when an absolute gap matters more than a ratio. section 10.2.2
  • For several assets, bound one weight or difference relative to their combined allocation, using a scalar such as α. section 10.2.2
constraints.append(l[i, j] * w[j] <= w[i])
constraints.append(w[i] <= u[i, j] * w[j])

CVXPY listing for imposing lower and upper ratio bounds between two portfolio weights. section 10.2.2

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Defines ratio, difference, and aggregate formulations with a numerical example, but does not develop a full optimization model.
Examples
Uses US, foreign developed, and emerging equities with a 6-to-1 reference ratio and 3-to-12 permitted range.
What it assumes
Assumes portfolio weights are nonnegative and introduces constraint syntax through allocation examples.
What you can do after
Implement ratio and aggregate relative-weight bounds in Python with CVXPY.
How it connects
Connects portfolio optimization with asset allocation, portfolio weights, and nonnegative-weight assumptions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.