A trading desk would like to hold units of an exposure, but a risk limit allows at most unit, and in a constructed model the cost of holding units is , half the squared distance from the target. The capped position of unit looks best, yet a picture is not a proof, and an optimizer that stops there gives no guarantee either. Convex duality supplies a proof that can be checked by hand, in the form of a multiplier attached to the limit, and the same multiplier says how fast the cost falls when the limit is relaxed. This lesson builds the Lagrangian and the lower bounds it produces, proves that the KKT conditions certify a global minimum of a convex problem, and states when Slater’s condition guarantees that such a certificate exists.
Key terms
Convex function
Definition A set is convex if it contains the segment between any two of its points, that is, whenever and . A function from a convex set to is convex if
for all and , and strictly convex if the inequality is strict whenever and . A differentiable on is convex if and only if it lies above each of its tangent planes,
for all and , and a twice continuously differentiable on is convex if and only if its Hessian is positive semidefinite at every point. So a quadratic with symmetric is convex exactly when is positive semidefinite.
In this lesson the standard problem is to minimize over subject to for and , where is a matrix and . It is a convex problem when and every are convex and finite on all of . Its feasible set is then convex, because each set and the affine set are convex and an intersection of convex sets is convex. For a convex problem every local minimizer is a global minimizer. If were a local minimizer and a feasible had , then every point with would be feasible with objective at most , and these points come arbitrarily close to as . Strict convexity of allows at most one minimizer. Neither property guarantees that a minimizer exists, which needs a further argument, for example a continuous objective on a nonempty compact feasible set.
In plain words A convex function never rises above the chord between two of its values. If no small feasible step away from a point lowers the objective, then no large step can, because the segment toward a better point would already lower the objective near its start. Convexity settles which minima count, not whether a minimum exists.
Example The desk’s cost has second derivative , so it is strictly convex, and its only minimizer over is . The function is strictly convex on but has no minimizer, since its infimum is never attained. A portfolio variance is convex because a covariance matrix is positive semidefinite, but a matrix assembled from separately chosen correlations need not be. In a constructed example with correlations , and ,
has eigenvalues , and . The direction gives , so along it the quadratic is concave and unbounded below. Even with the budget constraint , moving along , which keeps the budget, has , so the quadratic has no minimum over budget portfolios and its infimum there is . The KKT certificate of this lesson does not apply to such a problem.
Lagrangian
Definition For the standard problem, attach a multiplier to each inequality and a vector to the equalities . The Lagrangian is
with componentwise and unrestricted in sign. The sign restriction belongs to the direction of the inequalities, so a constraint must first be written as . In this lesson the letter denotes the dual function,
which may equal . For each fixed the Lagrangian is affine in , so the dual function, an infimum of affine functions, is concave whether or not the standard problem is convex.
In plain words The Lagrangian charges each constraint at a rate set by its multiplier. At a feasible point every inequality term is zero or negative and the equality term vanishes, so there the Lagrangian is at most the true objective. Minimizing it over all , feasible or not, gives the dual function.
Example The desk problem is to minimize subject to , with in units of exposure. Its Lagrangian is with . At the feasible point with it equals , below the cost of that point. For fixed the Lagrangian is a convex quadratic in whose derivative vanishes at , and substituting this point gives
for every .
Weak duality
Definition The dual problem is to maximize over and . Let be the optimal primal value, the infimum of over the feasible set, with when no point is feasible, and let be the optimal dual value, the supremum of over and all . Weak duality is the inequality . For any feasible , any and any ,
The first step holds because an infimum is at most each of its values, the equality because , and the last step because and . Taking the supremum on the left and the infimum on the right gives . The argument needs no convexity, no differentiability and no attained minimum. The difference , when it is defined, is the duality gap, and it is never negative.
In plain words Every choice of nonnegative multipliers gives a floor under all feasible objective values, and the dual problem looks for the highest floor. Every feasible point gives a ceiling. When a floor and a ceiling meet, the optimal value is known exactly and the feasible point attaining it is optimal, without any search of the feasible set.
Example In the desk problem , so no position with costs less than , while the feasible position costs . These two numbers alone place the optimal cost between and . The best floor maximizes , whose derivative vanishes at , so . The feasible position costs , the ceiling meets the floor, and .
KKT conditions
Definition Consider the standard problem with and every convex and differentiable on all of and affine equality constraints . A point with multipliers and satisfies the Karush-Kuhn-Tucker (KKT) conditions if it has primal feasibility, dual feasibility and complementary slackness,
for , together with stationarity,
Under these hypotheses the conditions are sufficient. If satisfies them, then is a global minimizer, is optimal for the dual problem, and . Because , the function is convex and differentiable, stationarity says its gradient vanishes at , and the tangent plane inequality makes a global minimizer of it. Complementary slackness and feasibility remove the constraint terms, so
By weak duality every feasible has , and every and have . No constraint qualification is needed in this direction. Complementary slackness forces for every inactive constraint, one with , while an active constraint, one with , may also have a zero multiplier. Without convexity the same four conditions can hold at a maximum or a saddle point.
In plain words A KKT point carries its own proof of optimality. The multipliers build a lower bound, and stationarity and complementary slackness show that this bound equals the objective at the candidate, so no feasible point can do better. Checking the four conditions takes a few lines of arithmetic, which is stronger evidence than a small gradient reported by a numerical method.
Example For the desk problem take and . Primal feasibility holds since , dual feasibility since , complementary slackness since , and stationarity since . The problem is convex, so the capped position is a global minimizer with cost , the value the dual bound already gave. If the limit is raised to , the target is feasible with , complementary slackness forces the multiplier to be , and stationarity holds, so with cost .
Strong duality and Slater’s condition
Definition Strong duality holds when . Equal values do not by themselves say that either optimum is attained. A constraint qualification is a condition on the constraints, not on the objective, that guarantees strong duality or the existence of KKT multipliers at a minimizer. For a convex standard problem, Slater’s condition asks for a strictly feasible point, an with and for every . A refined version lets affine inequality constraints hold with equality at . The following result is stated here without proof. If the standard problem is convex, Slater’s condition holds and is finite, then and the dual problem has an optimal solution . If in addition a primal minimizer exists and and the are differentiable, then satisfies the KKT conditions. That last step is elementary, since strong duality with both optima attained gives
so both inequalities are equalities. The nonpositive terms then add to zero, which is complementary slackness, and minimizes over , so its gradient there is zero. Hence, for a differentiable convex problem that satisfies Slater’s condition, a feasible point is optimal if and only if some multipliers satisfy the KKT conditions with it. Slater’s condition is sufficient for strong duality, not necessary, and it does not guarantee that a primal minimizer exists.
In plain words Weak duality always gives floors, and strong duality says the floors rise all the way to the optimal value. Slater’s condition asks for one point that satisfies every inequality with room to spare. For a convex problem with a finite optimal value, that one point is enough for the best floor to be reached exactly and for multipliers to exist at any minimizer.
Example The desk problem satisfies Slater’s condition, since has , and indeed with the dual optimum attained at . Now minimize subject to . The only feasible point is , so , but no point has and Slater’s condition fails. Stationarity would need , which no satisfies, so this minimizer has no KKT multipliers. The dual function has , and for the Lagrangian is smallest at , which gives
These values approach as but never reach it, so while no dual optimum exists. Without a constraint qualification a convex problem can even have a positive gap. Minimize over subject to , with the Euclidean norm. The constraint forces , so . Both terms of the Lagrangian are nonnegative, and along both tend to as , so for every and the gap is .
Binding constraint
Definition An inequality constraint is active at a feasible point when , and inactive, or slack, when . In this lesson a constraint is binding at the optimum when it is active there and relaxing it alone lowers the optimal value. Many texts use binding as a synonym for active, and the two differ only for an active constraint whose relaxation changes nothing. To measure relaxation, replace by and let be the optimal value of the perturbed problem, so relaxes constraint and tightens it. If strong duality holds at with a dual optimum , then for every
Indeed, any with for all and has , and the Lagrangian is at least . So relaxing constraint by lowers the optimal value by at most , tightening it by raises the value by at least , and a constraint with is not binding. If moreover is differentiable at , then
and a constraint with is binding, its relaxation lowering the value at the rate . Without differentiability a positive multiplier does not settle the question. If one constraint is written twice, the multipliers of the two copies need only add up to the multiplier of the single constraint, so one dual optimum can give a copy a positive multiplier although relaxing that copy alone changes nothing.
In plain words A multiplier prices a constraint in units of objective per unit of constraint. When strong duality holds, loosening a constraint can lower the optimal value by at most its multiplier times the amount of loosening, and when the optimal value depends differentiably on the limits it falls at exactly that rate at first. A slack constraint costs nothing at the margin.
Example Give the desk a limit , so the constraint is and raising relaxes it. For the optimal position is with cost , and for it is with cost . At the derivative of the cost with respect to is , which is for , measured in cost units per unit of the limit. Raising the limit to gives the cost , just above the bound , and lowering it to gives , just above . So the limit is binding. At the optimal position makes the constraint active, but stationarity gives the multiplier and every higher limit leaves the cost at , so the constraint is active and not binding. At it is slack.
Check yourself
- Minimize subject to . Write the constraint in standard form, find the KKT point and the dual function, and explain what goes wrong if the Lagrangian is written as with .
Show the answer
In standard form the constraint is , so the Lagrangian is with , and stationarity gives . The unconstrained minimizer is infeasible, so try the active constraint . It gives , and complementary slackness holds because . The problem is convex, so is the global minimizer, with cost . For the dual, the Lagrangian is smallest at , which gives
Its maximum is , equal to the primal cost, so there is no gap. The Lagrangian with and belongs to the opposite constraint . Its KKT system yields with , which violates , and forcing in it gives , which fails dual feasibility. The sign of a multiplier is tied to the direction of its inequality, so every constraint must be written as before the Lagrangian is formed.
- Minimize subject to , written as and . Show that with both multipliers equal to satisfies all four KKT conditions. Is a minimizer, and which hypothesis of the sufficiency result fails?
Show the answer
At both constraints hold strictly, the zero multipliers are nonnegative, complementary slackness holds trivially, and stationarity holds because the derivative of the objective is there. Yet the objective is at and at and , so is the global maximizer on the feasible set, not a minimizer. The objective is concave, not convex, so the step from stationarity to a minimizer of the Lagrangian fails. With both multipliers the Lagrangian is , which has a maximum at . For every choice of nonnegative multipliers the Lagrangian is a concave quadratic in , so the dual function is and . Weak duality still holds but says nothing useful. The true minimizers also satisfy the KKT conditions, with multipliers and with multipliers , so in a nonconvex problem the conditions cannot tell a maximum from a minimum.
- In a constructed model two assets have uncorrelated returns with annual variances and , so . Minimize subject to the budget . Find the KKT point, the dual function and the dual optimum, and check that there is no duality gap. Must the multiplier be nonnegative?
Show the answer
The budget is the equality with an unrestricted multiplier , and
Stationarity gives and , so and . The budget then gives , so
The objective is convex because is positive definite and the constraint is affine, so this KKT point is the global minimizer. Its variance is , so . For fixed the Lagrangian is smallest at , and with the dual function is
Its derivative vanishes at , where . The primal and dual values agree, so there is no gap. The multiplier is negative, and that is allowed, because only inequality multipliers carry a sign restriction. Changing the budget to scales the optimal weights by , so the optimal value is , whose derivative at is .