Reference 0008

Bound Dual Cheat Sheet

How to read lower-bound and upper-bound slack, duals, and portfolio meaning.

Bound Pair

floor <= w <= cap

lower slack = w - floor
upper slack = cap - w

Dual Pair

lower dual > 0 -> optimizer wants w below the floor
upper dual > 0 -> optimizer wants w above the cap

lower slack > 0 -> lower dual should be 0
upper slack > 0 -> upper dual should be 0

Long-Only Portfolio

floor = 0

lower slack = w
lower dual > 0 -> optimizer would prefer a negative or smaller weight
upper dual > 0 -> optimizer would prefer a larger weight

CVXPY Pattern

constraints = [
    w >= floor,   # lower bounds
    w <= cap,     # upper bounds
    cp.sum(w) == 1,
]

lower_duals = constraints[0].dual_value
upper_duals = constraints[1].dual_value

At the floor

w = floor. If the lower dual is positive, the model is pressing downward.

At the cap

w = cap. If the upper dual is positive, the model is pressing upward.

Inside bounds

floor < w < cap. Both bound duals should be zero, up to solver tolerance.

Constraint order

Read duals from the constraint object you created. Index names are only meaningful if you preserve the order.

Use this page with Lesson 0008, Lesson 0007, and Reference 0006.