At the floor
w = floor. If the lower dual is positive, the model is pressing downward.
How to read lower-bound and upper-bound slack, duals, and portfolio meaning.
floor <= w <= cap lower slack = w - floor upper slack = cap - w
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
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
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
w = floor. If the lower dual is positive, the model is pressing downward.
w = cap. If the upper dual is positive, the model is pressing upward.
floor < w < cap. Both bound duals should be zero, up to solver tolerance.
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.