Skip to content
BIASED

Unconstrained optimization

Block 1 of 7~3 min

How to recognize a minimum

The topic Convex sets and functions showed that for a convex loss every local minimum is global. It did not say how to find one. This topic does: first we learn to recognize a minimum, then to walk to it.

We minimize a differentiable f:Rn→Rf: \mathbb R^n \to \mathbb R over all of Rn\mathbb R^n. "Unconstrained" means any vector is allowed. For a model, ff is the loss L(θ)L(\theta) and xx is the parameter vector θ\theta.

First-order condition. If x∗x^* is a local minimum, then

∇f(x∗)=0.\nabla f(x^*) = 0.

Otherwise a small step against the gradient, the direction of steepest descent (see the topic Gradients, Jacobians and Hessians), would lower ff. Points with zero gradient are called critical (or stationary). Minima, maxima and saddle points are all critical.

Second-order conditions. At a critical point the gradient term of the Taylor expansion vanishes:

f(x∗+h)≈f(x∗)+12 h⊤∇2f(x∗) h.f(x^* + h) \approx f(x^*) + \tfrac12\, h^\top \nabla^2 f(x^*)\, h.

So the Hessian's quadratic form decides (see Symmetric matrices and quadratic forms):

  • necessary: at a local minimum ∇2f(x∗)⪰0\nabla^2 f(x^*) \succeq 0;
  • sufficient: ∇f(x∗)=0\nabla f(x^*) = 0 and ∇2f(x∗)≻0\nabla^2 f(x^*) \succ 0 give a strict local minimum;
  • eigenvalues of both signs give a saddle.

The gap between ⪰\succeq and ≻\succ is real. Both x12+x24x_1^2 + x_2^4 and x12−x24x_1^2 - x_2^4 have zero gradient and Hessian diag⁡(2,0)\operatorname{diag}(2, 0) at the origin. The first has a minimum there, the second a saddle.

Convex case. If ff is convex, ∇f(x∗)=0\nabla f(x^*) = 0 alone means a global minimum: the tangent plane lies below the graph, and here it is flat.

For least squares, ∇L(θ)=0\nabla L(\theta) = 0 is the normal equations X⊤Xθ=X⊤yX^\top X \theta = X^\top y (see Inner products, norms and orthogonality). That is a linear system we solve once. For logistic regression, ∇L(θ)=0\nabla L(\theta) = 0 is a nonlinear system with no closed form. So we iterate.

Answers are saved on the server and tied to this browser until you sign in.