Reference 0006

Solver Dual Diagnostics

A compact checklist for interpreting inequality dual values in portfolio optimizers.

Read slack first

For g(x) <= h, slack is h - g(x*). Positive slack means the constraint is loose.

Then read dual

For standard convex inequality constraints, a loose constraint should have a zero multiplier.

Tight plus nonzero

A near-zero slack and positive dual means this constraint is actively shaping the optimum.

Tight plus zero

A constraint can be tight without having local value. It touches the solution but is not scarce at the margin.

Diagnostic Table

slack > 0, dual = 0   -> inactive; relaxing it should not help locally
slack = 0, dual > 0   -> active and scarce; relaxing it may help locally
slack = 0, dual = 0   -> active but not scarce; inspect degeneracy or redundancy
slack > 0, dual > 0   -> suspicious; check tolerance, sign convention, or formulation

Portfolio Translation

asset cap dual      -> model wants more of that asset
sector cap dual     -> model wants more of that sector
turnover dual       -> trading budget is scarce
leverage dual       -> gross exposure budget is scarce
risk-limit dual     -> risk budget is scarce

CVXPY Pattern

constraints = [
    w >= 0,
    w <= cap,
    cp.sum(w) == 1,
]
prob = cp.Problem(objective, constraints)
prob.solve()

upper_cap_duals = constraints[1].dual_value

Sign Warning

Dual signs depend on whether the problem is written as minimization or maximization and on the inequality direction. The stable workflow is: identify the convention, compute slack, then interpret the multiplier as marginal pressure on that constraint.

Use this page with Lesson 0006, Reference 0005, and the official CVXPY dual variables guide.