liveBook · Manning

Individual position constraint

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

An individual position constraint limits the allocation or magnitude of a single portfolio holding.

An individual position constraint caps the weight of a single portfolio holding: w_i ≤ u_i. It supports diversification and limits risks that historical-data estimates may miss. section 10.2.2

Asset-specific limits use an upper-bound array u. When every nonnegative weight shares a 0.5 cap, the infinity-norm form limits the magnitude of every entry in w to 0.5. section 10.2.2

constraints.append(w[i] <= u[i])

Append an asset-specific upper bound directly to an existing cvxpy constraint list. section 10.2.2

constraints.append(cp.norm_inf(w) <= 0.5)

Apply one common maximum magnitude to every portfolio weight with cvxpy’s infinity norm. section 10.2.2

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

How deep it goes
Defines the inequality and provides asset-specific and uniform cvxpy implementations.
Examples
Uses asset-specific upper bounds and a uniform 0.5 maximum for every portfolio weight.
What it assumes
Assumes defined portfolio weights, problem data, an existing constraint list, and nonnegative weights.
What you can do after
Apply it via cvxpy to cap individual holdings in portfolio-optimization problems.
How it connects
Connects portfolio weights with diversification, risk estimates, nonnegative constraints, and convex optimization.

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.