Lecture 21: Constrained optimization (equality constraints)
Overview
Burton Ma develops the first-order method for equality-constrained optimization by connecting feasible directions, level-set geometry, and gradients, then formalizing the relationship with Lagrange multipliers. Examples include finding the nearest point on a line, minimizing a linear function on a parabola, and minimizing a Mahalanobis distance; the resulting Lagrangian conditions reduce one constraint problem to a system of equations, which may be nonlinear.
Key takeaways
- At a regular constrained minimum with one equality constraint, the objective gradient is a scalar multiple of the constraint gradient, so it need not be zero.
- The condition h(w) = 0 describes a level set, and ∇h gives its normal direction wherever ∇h is nonzero.
- The Lagrangian L(w, μ) = F(w) + μh(w) produces the first-order equations ∇F(w*) + μ*∇h(w*) = 0 and h(w*) = 0.
- For the parabola constraint w₂ = (w₁ − 1)² + 1 and objective w₁ + w₂, substitution reduces the problem to one variable and gives the minimum at (0.5, 1.25), with value 1.75.
- A Mahalanobis objective creates covariance-scaled, potentially rotated elliptical level sets; the constrained minimum occurs where one such ellipse is tangent to the constraint.
- Lagrange multiplier equations are necessary conditions, not sufficient proof of a minimum, and solving them may require handling a nonlinear system.
Chapters
- The lecture extends unconstrained optimization, where a minimizer often satisfies ∇F(w*) = 0, to problems with equality constraints.
- Constraints are written as h(w) = 0, with any constant moved to the left side.
- Lagrange introduced the multiplier method in 1788 while studying the Moon's libration, its apparent wobble in orbit.
- The constraint h(w) = 0 defines a level set, and ∇h is perpendicular to its tangent surface when the gradient is nonzero.
- For a circle, h(x,y) = x² + y² − r² gives ∇h = (2x, 2y), the radial normal direction.
- For a sphere, the corresponding gradient is (2x, 2y, 2z), illustrating the same geometry in three dimensions.
- The example minimizes squared distance from a point w₀ to a line, with the closest point at (0, 2) and objective value 11.25.
- The objective gradient is 2w − 2w₀, while the line constraint has constant gradient (−1, 2).
- At the minimizing point, the objective gradient is three times the constraint gradient, so their directions are parallel.
- Moving a small distance along the feasible line produces no first-order change in the objective at the minimum.
- The constraint (w₁ − 1)² − w₂ + 1 = 0 can be rearranged as w₂ = (w₁ − 1)² + 1.
- Substituting into F(w) = w₁ + w₂ reduces the constrained problem to a one-variable quadratic.
- Setting the derivative to zero gives w₁* = 0.5, w₂* = 1.25, and minimum value 1.75.
- At the solution, ∇F = (1, 1) and ∇h = (−1, −1), so the gradients are anti-parallel.
- The objective uses a covariance-scaled distance, wᵀΣ⁻¹w, rather than ordinary Euclidean distance to the origin.
- A rotated inverse covariance matrix creates elliptical objective level sets oriented at 45 degrees, with different scaling along the two principal directions.
- The ellipse that touches the parabola at one point identifies the constrained minimizer; the lecture gives an approximate minimum value of 0.8559.
- For this quadratic objective, the gradient is 2Σ⁻¹w, and at the minimizing point it is anti-parallel to the constraint gradient.
- Across the line, parabola, and Mahalanobis examples, ∇F at the constrained minimum is not zero, unlike the usual unconstrained first-order condition.
- The observed condition is that ∇F is parallel or anti-parallel to ∇h, the normal direction of the constraint surface.
- In higher dimensions, the gradient relationship generalizes from R², with the constraint gradient spanning the normal direction for one equality constraint.
- For one differentiable equality constraint, define L(w, μ) = F(w) + μh(w), where μ is the scalar Lagrange multiplier.
- The first-order theorem states that a constrained minimizer corresponds to a stationary point of L under suitable regularity conditions.
- The constraint qualification here requires ∇h(w*) ≠ 0, so the constraint has a well-defined normal direction at the solution.
- Stationarity supplies necessary conditions, not a guarantee of a minimum; candidate points may also be maxima or saddle points.
- Taking the gradient of L with respect to both w and μ yields the conditions ∇F(w*) + μ*∇h(w*) = 0 and h(w*) = 0.
- The μ derivative reproduces the equality constraint, while the w derivatives show that the objective and constraint gradients differ only by a scalar factor.
- The sign of μ determines whether the two gradient vectors point in the same or opposite directions.
- For an n-dimensional problem with one equality constraint, the Lagrangian conditions provide n + 1 equations for the n coordinates of w and the multiplier μ.
- Solving the equations produces candidate stationary points, which still need to be checked to determine whether they minimize F.
- The method can be difficult when the resulting system is nonlinear; examples and further applications are deferred to the next lecture.
Transcript excerpt
0:01 All right. Good morning, everybody. Um, uh, so we were looking at constrained optimization in the last class. Uh, so that that was the topic that was introduced in the last lecture. Um, so now we want to We didn't actually look at how to solve one of these constrained optimization problems in general. Uh, and so that's the problem that we want to tackle today and probably next week, uh, for a few lectures. All right. So let's see. Um, we want to try to solve these problems in a similar way, uh, that we solved the unconstrained optimization problem. So in the unconstrained optimization problem, the first and second derivatives play an important role, uh, in solving the problem.
0:48 And multivariate functions, obviously it's the gradient and the Hessian now that become uh essential. Uh, so in constrained optimization, the problem that you have is that there's not just one objective function, uh, but there's a whole bunch of or possibly a whole bunch of um constraint functions as well that we have to consider. Um, so we have equality constraints and inequality constraints. Uh, we're going to tackle the equality constraints first because it's a little bit easier uh to derive the necessary machinery. All right. Unconstrained optimization. You're looking for uh well, one way that you can solve these problems is to set the gradient to zero, uh, solve for the quantities of interest, right? And so you can interpret this condition as meaning uh for any
1:35 infinitesimally small change in W star, there's no change in the value of F. So if you're thinking about one dimensional optimization, right? We're looking for somewhere where the derivative goes to zero. Well, sorry, it's not a very good picture. So we're looking for that point there. Right? So the derivative goes to zero.
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Burton Ma.