Docsity

Numerical Optimization - Lecture Notes | EECS 260, Study notes of Optimization Techniques in Engineering

Toggle sidebar
bg1
EECS260 Optimization — Lecture notes
Based on “Numerical Optimization” (Nocedal & Wright, Springer, 2nd ed., 2006)
Miguel ´
A. Carreira-Perpi˜n´an
EECS, University of California, Merced
February 17, 2010
1 Introduction
•Goal: describe the basic concepts & main state-of-the-art algorithms for continuous opti-
mization.
•The optimization problem:
min
x∈Rnf(x) s.t. ci(x) = 0, i ∈ E equality constraints (scalar)
ci(x)≥0, i ∈ I inequality constraints (scalar)
x: variables (vector); f(x): objective function (scalar).
Feasible region: set of points satisfying all constraints.
max f≡ −min −f.
•Ex. (fig. 1.1): min (x1−2)2+ (x2−1)2s.t. x2
1−x2≤0
x1+x2≤2.
•Ex.: transportation problem (LP)
min X
i,j
cijxij s.t.
Pjxij ≤ai∀i(capacity of factory i)
Pixij ≥bj∀i(demand of shop j)
xij ≥0∀i, j (nonnegative production)
cij: shipping cost; xij : amount of product shipped from factory ito shop j.
•Ex.: LSQ problem: fit a parametric mo del (e.g. line, polynomial, neural net.. . ) to a data
set (Ex. 2.1).
•Optimization algorithms are iterative: build sequence of points that converges to the solu-
tion. Needs good initial point (often by prior knowledge).
•Focus on many-variable problems (but will illustrate in 2D).
•Desiderata for algorithms:
–Robustness: perform well on wide variety of problems in their class, for any starting
point;
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31

Partial preview of the text

Download Numerical Optimization - Lecture Notes | EECS 260 and more Study notes Optimization Techniques in Engineering in PDF only on Docsity!

EECS260 Optimization — Lecture notes

Based on “Numerical Optimization” (Nocedal & Wright, Springer, 2nd ed., 2006)

Miguel A. Carreira-Perpi˜´ n´an

EECS, University of California, Merced

February 17, 2010

1 Introduction

  • Goal: describe the basic concepts & main state-of-the-art algorithms for continuous opti- mization.
  • The optimization problem:

xmin∈Rn^ f^ (x) s.t.

ci(x) = 0, i ∈ E equality constraints (scalar) ci(x) ≥ 0 , i ∈ I inequality constraints (scalar)

x: variables (vector); f (x): objective function (scalar). Feasible region: set of points satisfying all constraints. max f ≡ − min −f.

  • Ex. (fig. 1.1): min (x 1 − 2)^2 + (x 2 − 1)^2 s.t.

x^21 − x 2 ≤ 0 x 1 + x 2 ≤ 2.

  • Ex.: transportation problem (LP)

min

i,j

cij xij s.t.

∑^ j^ xij^ ≤^ ai^ ∀i^ (capacity of factory^ i) i xij^ ≥^ bj^ ∀i^ (demand of shop^ j) xij ≥ 0 ∀i, j (nonnegative production)

cij : shipping cost; xij : amount of product shipped from factory i to shop j.

  • Ex.: LSQ problem: fit a parametric model (e.g. line, polynomial, neural net... ) to a data set (Ex. 2.1).
  • Optimization algorithms are iterative: build sequence of points that converges to the solu- tion. Needs good initial point (often by prior knowledge).
  • Focus on many-variable problems (but will illustrate in 2D).
  • Desiderata for algorithms:
    • Robustness: perform well on wide variety of problems in their class, for any starting point;
  • Efficiency: little computer time or storage;
  • Accuracy: identify solution precisely (within the limits of fixed-point arithmetic).

They conflict with each other.

  • General comment about optimization (Fletcher): “fascinating blend of theory and compu- tation, heuristics and rigour”. - No universal algorithm: a given algorithm works well with a given class of problems. - Necessary to adapt a method to the problem at hand (by experimenting). - Not choosing an appropriate algorithm → solution found very slowly or not at all.
  • Not covered in the Nocedal-Wright book, or in this course:
    • Discrete optimization (integer programming): the variables are discrete. Ex.: integer transportation problem, traveling salesman problem. ∗ Harder to solve than continuous opt (in the latter we can predict the objective function value at nearby points). ∗ Too many solutions to count them. ∗ Rounding typically gives very bad solutions. ∗ Highly specialized techniques for each problem type. Ref: Papadimitriou & Steiglitz.
    • Network opt: shortest paths, max flow, min cost flow, assignments & matchings, MST, dynamic programming, graph partitioning... Ref: Ahuja, Magnanti & Orlin.
    • Non-smooth opt: discontinuous derivatives, e.g. L 1 -norm. Ref: Fletcher.
    • Stochastic opt: the model is specified with uncertainty, e.g. x ≤ b where b could be given by a probability density function.
    • Global opt: find the global minimum, not just a local one. Very difficult. Some heuristics: simulated annealing, genetic algorithms, evolutionary computation.
    • Multiobjective opt: one approach is to transform it to a single objective = linear combinations of objectives.
    • EM algorithm (Expectation-Maximization): specialized technique for maximum like- lihood estimation of probabilistic models. Ref: McLachlan & Peel; many books on statistics or machine learning.
    • Calculus of variations: stationary point of a functional (= function of functions).
    • Convex optimization: we’ll see some of this. Ref: Boyd & Vandenberghe.
    • Modeling: the setup of the opt problem, i.e. the process of identifying objective, vari- ables and constraints for a given problem. Very important but application-dependent. Ref: Dantzig; Ahuja et al.
  • Course contents: derivative-based methods for continuous optimization (see syllabus).

Algorithm overview

  • Algorithms look for a stationary point starting from a point x 0 (arbitrary or user-supplied) ⇒ sequence of iterates {xk}∞ k=0 that terminates when no more progress can be made, or it seems that a solution has been approximated with sufficient accuracy.
  • Stopping criterion: can’t use ‖xk − x∗‖ or |f (xk) − f (x∗)|. Instead, in practice (given a small ǫ > 0): - ‖∇f (xk)‖ < ǫ - ‖xk − xk− 1 ‖ < ǫ or ‖xk − xk− 1 ‖ < ǫ ‖xk− 1 ‖ - |f (xk) − f (xk− 1 )| < ǫ or |f (xk) − f (xk− 1 )| < ǫf (xk− 1 )

and also set a limit on k.

  • We choose xk+1 given information about f at xk (and possibly earlier iterates) so that f (xk+1) < f (xk) (descent).
  • Move xk → xk+1: two fundamental strategies, line search and trust region.
    • Line search strategy
      1. Choose a direction pk
      2. Search along pk from xk for xk+1 with f (xk+1) < f (xk), i.e., approximately solve the 1D minimization problem: minα> 0 f (xk + αpk) where α = step length.
    • Trust region strategy
      1. Construct a model function mk (typ. quadratic) that is similar to (but simpler than) f around xk.
      2. Search for xk+1 with mk(xk+1) < m(xk) inside a small trust region (typ. a ball) around xk, i.e., approximately solve the n-D minimization problem: minp mk(xk + p) s.t. xk + p ∈ trust region.
      3. If xk+1 does not produce enough decay in f , shrink the region.
  • In both strategies, the subproblem (step 2) is easier to solve with the real problem. Why not solve the subproblem exactly? - Good: derives maximum benefit from pk or mk; but - Bad: expensive (many iterations over α) and unnecessary towards the real problem (min f over all Rn).
  • Both strategies differ in the order in which they choose the direction and the distance of the move: - Line search: fix direction, choose distance. - Trust region: fix maximum distance, choose direction and actual distance.

Scaling (“units” of the variables)

A problem is poorly scaled if changes to x in a certain direction produce much larger variations in the value of f than do changes to x in another direction. Some algorithms (e.g. steepest descent) are sensitive to poor scaling while others (e.g. Newton’s method) are not. Generally, scale-invariant algorithms are more robust to poor problem formulations. Ex. f (x) = 10^9 x^21 + x^22 (fig. 2.7). Related, but not the same as ill-conditioning. Ex. f (x) = 12 xT^

( (^1) 1+ǫ 1+ǫ 1

x − ( 2+ 2 ǫ) x.

Review of conditions for a minimizer

Assuming the derivatives ∇f (x∗), ∇^2 f (x∗) exist and are continuous in a neighbourhood of x∗:

  • x∗^ is a local minimiser ⇒

{ ∇f (x∗) = 0 (first order) ∇^2 f (x∗) psd (second order) (necessary condition).

  • ∇f (x∗) = 0, ∇^2 f (x∗) pd ⇒ x∗^ is a strict local minimiser (sufficient condition).
  • Stationary point: ∇f (x∗) = 0; ∇^2 f (x∗)

    

pd: strict local minimiser nd: strict local maximiser not definite (pos & neg eigenvalues): saddle point psd: may be non-strict local minimiser nsd: may be non-strict local maximiser

Wolfe conditions

À f (xk + αkpk) ≤ f (xk) + c 1 αk∇f (^) kT pk;

Á ∇f (xk + αkpk)T^ pk ≥ c 2 ∇f (^) kT pk.

where 0 < c 1 < c 2 < 1. Call φ(α) = f (xk + αpk), then φ′(α) = ∇f (xk + αpk)T^ pk.

À Sufficient decrease (Armijo condition) is equivalent to φ(0) − φ(xk) ≥ αk(−c 1 φ′(0)). Rejects too small decreases. The reduction is proportional both to step length αk and directional derivative ∇f (^) kT pk (fig. 3.3). In practice, c 1 is very small, e.g. c 1 = 10−^4. It is satisfied for any sufficiently small α ⇒ not enough, need to rule out unacceptably small steps.

Á Curvature condition is equivalent to −φ′(xk) ≤ −c 2 φ′(0). Rejects too negative slopes. Reason: if the slope at α, φ′(α), is strongly negative, it’s likely we can reduce f significantly by moving further (fig. 3.4, 3.5).

In practice, c 2 =

0 .9 if pk is chosen by a Newton or quasi-Newton method 0 .1 if pk is chosen by a nonlinear conjugate method.

We will concentrate on the Wolfe conditions in general, and assume they always hold when the l.s. is used as part of an optimization algorithm (allows convergence proofs).

Lemma 3.1: there always exist step lengths that satisfy the Wolfe (also the strong Wolfe) condi- tions if f is smooth and bounded below. (Pf. mean value th.; see figure below.)

φ(α) = f (xk + αpk) l(α) = fk − (−c 1 ∇f (^) kT pk)α = fk − (−c 1 φ′(0))α

Other useful conditions

  • Strong Wolfe conditions: À + Á’

∇f (xk + αkpk)T^ pk

≤ c 2

∇f (^) kT pk

. We don’t allow φ′(αk) to be too positive, so we exclude points that are far from stationary points of φ.

  • Goldstein conditions (fig. 3.6):

f (xk) + (1 − c)αk∇f (^) kT pk

(a) ≤ f (xk + αkpk)

À ≤ f (xk) + cαk∇f (^) kT pk, 0 < c < (^12)

(a) controls step from below. Disadvantage: may exclude all minimizers of φ. ( 0 do the Wolfe conditions exclude minimizers?)

Sufficient decrease and backtracking

Start with largish step size and decrease it (times ρ < 1) until it meets the sufficient decrease condition À (Algorithm 3.1).

  • It’s a heuristic approach to avoid a more careful l.s. that satisfies the Wolfe cond.
  • It always terminates because À is satisfied by sufficiently small α.
  • Works well in practice because the accepted αk is near (times ρ) the previous α, which was rejected for being too long.
  • The initial step length α is 1 for Newton and quasi-Newton methods.

Step-length selection algorithms

  • They take a starting value of α and generate a sequence {αi} that satisfies the Wolfe cond. Usually they use interpolation, e.g. approximate φ(α) as a cubic poly.
  • There are also derivative-free methods (e.g. the golden section search) but they are less efficient and can’t benefit from the Wolfe cond. (to prove global convergence).
  • We’ll just use backtracking for simplicity.

Convergence of line search methods

  • Global convergence: ‖∇fk‖ −−−→ k→∞

0, i.e., convergence to a stationary point for any starting point x 0. To converge to a minimizer we need more information, e.g. the Hessian.

  • We give a theorem for the search direction pk to obtain global convergence, focusing on the angle θk between pk and the steepest descent direction −∇fk: cos θk = −∇f^ kT p ‖∇fk ‖‖p‖ , and assuming the Wolfe cond. Similar theorems exist for strong Wolfe, Goldstein cond.
  • Important theorem, e.g. shows that the steepest descent method is globally convergent; for other algorithms, it describes how far pk can deviate from the steepest descent direction and still give rise to a globally convergent iteration.
  • Ill-conditioned Hessian: λ 1 ≪ λn; very slow, zigzagging behaviour. This is the typical situation in practice.
  • Newton’s method : pk = −∇^2 f (^) k− 1 ∇fk. Th. 3.5: assume f twice diff. and ∇^2 f Lipschitz cont. in a neighborhood of a solution x∗^ at the which second-order sufficient cond. hold. Consider the iterates xk+1 = xk − ∇^2 f (^) k− 1 ∇fk. Then, if x 0 is sufficiently close to x∗: (xk) → x∗, (‖∇fk‖) → 0 both quadratically. (Pf.: upper bound ‖xk + pk − x∗‖ by a constant × ‖xk − x∗‖^2 using Taylor + Lipschitz.) That is, near the solution, where the Hessian is pd, the convergence rate is quadratic if we always take αk = 1 (no line search at all). The theorem does not apply if the Hessian is not pd (away from the solution); practical Newton methods avoid this.
  • Quasi-Newton methods: pk = −B− k 1 ∇fk with Bk symmetric pd. Th. 3.7: assume f is twice cont. diff. and that the iterates xk+1 = xk − B− k 1 ∇fk converge to a point x∗^ at the which second-order sufficient cond. hold. Then (xk) → x∗^ superlinearly iff limk→∞^ ‖(Bk^ −∇

(^2) f (x∗))pk ‖ ‖pk ‖ = 0. Thus, the convergence rate is superlinear if the matrices Bk become increasingly accurate approximations of the Hessian along the search directions pk, and near the solution the step length αk is always 1, i.e., xk+1 = xk + pk. In practice, we must always try α = 1 in the line search and accept it if it satisfies the Wolfe cond.

Newton’s method with Hessian modification

Newton step: solution of the n × n linear system ∇^2 f (xk)pN k = −∇f (xk).

  • Near a minimizer the Hessian is pd ⇒ quadratic convergence (with unit steps αk = 1).
  • Away from a minimizer the Hessian may not be pd or may be close to singular ⇒ pN k may be an ascent direction, or too long. A too long direction may not be good even if it is a descent di- rection, because it violates the spirit of Newton’s method (which relies on a quadratic approximation valid near the current iter- ate); thus it may require many iterations in the line search.

Modified Newton method : modify the Hessian to make it sufficiently pd.

  • We solve (by factorizing Bk, e.g. Cholesky) the system Bkpk = −∇f (xk) where Bk = ∇^2 f (xk) + Ek (modified Hessian) such that Bk is sufficiently pd. Then we use pk (which is a descent direction because Bk is pd) in a line search with Wolfe conditions.
  • Global convergence (‖∇fk‖ → 0) by Zoutendijk’s condition if κ(Bk) = ‖Bk‖

B− k^1

≤ M

(which can be proven for several types of modifications).

  • Quadratic convergence near the minimizer, where the Hessian is pd, if Ek = 0 there.

Diagonal Hessian modification: Ek = λI with λ ≥ 0 large enough that Bk is sufficiently pd. λ = max(0, δ − λmin(∇^2 f (xk ))) for δ ≥ 0.

  • We want λ as small as possible to preserve Hessian information along the positive curvature directions; but if λ is too small, Bk is nearly singular and the step too long.
  • The method behaves like pure Newton for pd Hessian and λ = 0, like steepest descent for λ → ∞, and finds some descent direction for intermediate λ.

Other types of Hessian modification exist, but there is no consensus about which one is best:

  • Direct modification of the eigenvalues (needs SVD of the Hessian). If A = QΛQT^ (spectral th.) then ∆A = Q diag (max(0, δ − λi)) QT^ is the correction with minimum Frobenius norm s.t. λmin(A + ∆A) ≥ δ.
  • Modified Cholesky factorization (add terms to diagonal on the fly).

Review of line search (l.s.) methods

  • Iteration xk+1 = xk + αkpk

{ search direction pk given by optimization method l.s. ≡ determine step length αk

  • We want:
    • Descent direction: pTk ∇fk = ‖pk‖ ‖∇fk‖ cos θk < 0

 



steepest descent dir. : −∇fk Newton dir. : −∇^2 f (^) k− 1 ∇fk Quasi-Newton dir. : −B− k 1 ∇fk (Bk pd ⇒ descent dir.)

  • Inexact l.s.: approx. solution of minα> 0 f (xk + αkpk) (faster convergence of the overall algorithm). Even if the l.s. is inexact, if αk satisfies certain conditions at each k then the overall algorithm has global convergence. Ex.: the Wolfe conditions (others exist), most crucially the sufficient decrease in f. A simple l.s. algorithm that often (not always) satisfies the Wolfe cond. is backtracking (better ones exist).
  • Global convergence (to a stationary point): ‖∇fk‖ → 0. Zoutendijk’s th: descent dir + Wolfe + mild cond. on f ⇒

∑ k≥ 0 cos^2 θk^ ‖∇fk‖

(^2) < ∞. Corollary: cos θk ≥ δ > 0 ∀k ⇒ global convergence. But we often want cos θk ≈ 0! Ex.: steepest descent and some Newton-like methods have global convergence.

  • Convergence rate:
    • Steepest descent: linear, r =

( (^) λn−λ 1 λn+λ 1

) 2 ; slow for ill-conditioned problems.

  • Quasi-Newton: superlinear under certain conditions.
  • Newton: quadratic near the solution.
  • Modified Hessian Newton’s method: Bk = ∇^2 f (xk) + λI (diagonal modif., others exist) s.t. Bk suffic. pd. λ = 0: pure Newton step; λ → ∞: steepest descent direction (with step → 0). Descent direction with moderate length away from minimizer, pure Newton’s method near minimizer. Global, quadratic convergence if κ(Bk) ≤ M and l.s. with Wolfe cond.

Approximate solution of the optimization subproblem The Cauchy point pC k is the minimizer along pk = −∇mk( 0 ) = −gk, which lies either at −∆ gkk gk (boundary) or at −τk ∆ gkk gk with 0 < τk < 1 (interior); eq. (4.12), fig. 4.3. Thus, it is steepest descent with a certain step size, and gives a baseline solution. Several methods improve over the Cauchy point. One approach is based on the following characterization of the exact solution: Th. 4.1. p∗^ is a global solution of the trust-region problem min‖p‖≤∆ m(p) = f + gT^ p + 12 pT^ Bp iff p∗^ is feasible and ∃λ ≥ 0 such that:

  1. (B + λI)p∗^ = −g
  2. λ(∆ − ‖p∗‖) = 0 (i.e., λ = 0 or ‖p∗‖ = ∆)
  3. B + λI is psd.

Algorithm:

  1. Try λ = 0, solve Bp∗^ = −g and see if ‖p∗‖ ≤ ∆ (full step).
  2. If ‖p∗‖ > ∆, define p(λ) = −(B + λI)−^1 g for λ sufficiently large that B + λI is pd and seek a smaller value λ > 0 such that ‖p(λ)‖ = ∆ (1D root-finding for λ; iterative solution factorizing the matrix B + λI). B = QΛQT^ (spectral th. with λn ≥ · · · ≥ λ 1 ) ⇒ p(λ) = −(B + λI)−^1 g = − Pnj=1^ q

Tj g λj +λ qj^ ⇒ ‖p(λ)‖^2 =^

Pn j=

(qTj g)^2 (λj +λ)^2 (fig. 4.5). If qT 1 g 6 = 0, find λ∗^ > −λ 1 using Newton’s method for root finding on r(λ) = (^) ∆^1 − (^) ‖p(^1 λ)‖ (since (^) ‖p(^1 λ)‖ ≈ (λ + λ 1 )/constant). One can show this is equivalent to Alg. 4.3, which uses Cholesky factorizations (limit to ∼ 3 steps).

Note:

  • Using B + λI instead of B in the model transforms the problem into minp m(p) + λ 2 ‖p‖^2 , and so for large λ > 0 the minimizer is strictly inside the region. As we decrease λ the minimizer moves to the region boundary and the theorem holds for that λ.
  • If λ > 0 then the direction is antiparallel to the model gradient and so the region is tangent to the model contour at the solution: λp∗^ = −g − Bp∗^ = −∇m(p∗).
  • This is useful for Newton’s method and is the basis of the Levenberg-Marquardt algorithm for nonlinear least-squares problems.

Other approaches:

  • Dogleg method: find minimizer along two-leg path 0 → pC k → pB k (fig. 4.4).
  • Two-dimensional subspace minimization: on the span of the dogleg path.

Global and local convergence

  • Under certain assumptions, these approximate algorithms have global convergence to a stationary point (Th. 4.6). Essentially, they must ensure a sufficient decrease mk ( 0 ) ≤ mk (pk ) at each step; the Cauchy point already achieves such as decrease.
  • If using Bk = ∇^2 fk and if the region becomes eventually inactive and we always take the full step, the convergence is quadratic (the method becomes Newton’s method).

Review of trust-region methods

  • Iteration xk+1 = xk + pk
    • pk = approx. minimizer of model mk of f in trust region: min‖p‖≤∆k mk(p).
    • pk does not produce sufficient decrease ⇒ region too big, shrink it and try again. Insufficient decrease ⇔ ρk = (^) mfkk^ − ( 0 f)^ (−xmk^ +k p(pkk^ ) ). 0
  • Quadratic model: mk(p) = fk + ∇f (^) kT p + 12 pT^ Bkp. Bk need not be psd. Cauchy point: minimizer of mk within the trust region along the steepest descent direction. The exact, global minimizer of mk within the trust region ‖p‖ ≤ ∆k satisfies certain conditions (th. 4.1) that can be used to find an approximate solution. Simpler methods exist (dogleg, 2D subspace min.).
  • Global convergence under mild conditions if sufficient decrease; quadratic rate if Bk = ∇^2 fk and if the region becomes eventually inactive and we always take the full step.
  • Mainly used for Newton and Levenberg-Marquardt methods.
  • xk is the minimizer of φ over the set x 0 + span {p 0 ,... , pk− 1 }. That is, the method minimizes φ piecewise, one direction at a time. (Proof: induction plus the fact rk+1 = rk + αk Apk (implied by rk = Axk − b and xk+1 = xk + αk pk ).)
  • How to obtain conjugate directions? Many ways, e.g. using the eigenvectors of A or transforming a set of l.i., vectors into conjugate directions with a procedure similar to Gram-Schmidt. But these are computationally expensive!
  • The conjugate gradient method generates conjugate direction pk by using only the previous one, pk− 1 :
  • pk is a l.c. of −∇φ(xk) and pk− 1 s.t. being conjugate to pk− 1 ⇒ pk = −rk + βkpk− 1 with βk = r

Tk Apk− 1 pTk− 1 Apk− 1

  • We start with the steepest descent direction: p 0 = −∇φ(x 0 ) = −r 0.

Algorithm 5.1 (CG; preliminary version): given x 0 :

r 0 ← ∇φ(x 0 ) = Ax 0 − b, p 0 ← −r 0 , k → 0 Start with steepest descent dir. from x 0 while rk 6 = 0 rk = 0 means we are done, which may happen before n steps αk ← − r

Tk pk pTk Apk ,^ xk+1^ ←^ xk^ +^ αkpk^ Exact line search rk+1 = Axk+1 − b New residual βk+1 ← r

Tk+1Apk pTk Apk ,^ pk+1^ =^ −rk+1^ +^ βk+1pk^ New l.s. direction^ pk+1^ is conjugate to^ pk^ ,^ pk−^1 ,... ,^ p^0 k ← k + 1 end To prove the algorithm works, we need to prove it builds a conjugate direction set.

  • Th. 5.3: suppose that the kth iterate of the CG method is not the solution x∗. Then:
    • rTk ri = 0 for i = 0,... , k − 1 (the gradients at all iterates are ⊥ to each other) (by construction: at the l.s. minimizer, the gradient is ⊥ to the direction search pk− 1 ∈ span{r 0 ,... , rk− 1 })
    • span {r 0 ,... , rk} = span {p 0 ,... , pk} = span

r 0 , Ar 0 ,... , Akr 0

= Krylov subspace of degree k for r 0. ({rk } orthogonal basis, {pk } basis) (Intuitive explanation: compute rk , pk for k = 1, 2 using rk+1 = rk + Ak pk , pk+1 = −rk+1 + βk+1pk .)

  • pTk Api = 0 for i = 0,... , k − 1 (conjugate (by construction))

Thus the sequence {xk} converges to x∗^ in at most n steps. Important: the theorem needs that the first direction be the steepest descent dir. (Proof: induction.)

  • We can simplify a bit the algorithm using the following results:
    • pk+1 = −rk+1 + βk+1pk (construction of the kth direction)
    • rk+1 = rk + αkApk
    • rTk pi = rTk ri = 0 for i < k (th. 5.2 & 5.3)

⇒ αk ← r

Tk rk pTk Apk =^

‖rk ‖^2 ‖pk ‖^2 A^ ,^ rk+1^ ←^ rk^ +^ αkApk,^ βk+1^ ←^

rTk+1rk+ rTk rk =^

‖rk+1‖^2 ‖rk ‖^2 in^ algorithm 5.2.

  • Space complexity: O(n) since it computes x, r, p at k + 1 given the values at k: no matrix storage.
  • Time complexity: the bottleneck is the matrix-vector product Apk, which is O(n^2 ) (maybe less if A has structure) ⇒ in n steps, O(n^3 ), similar to other methods for solving linear systems (eg. Gauss factorization).
  • Advantages: no matrix storage; does not alter A; does not introduce fill (for a sparse matrix A); fast convergence.
  • Disadvantages: sensitive to roundoff errors.

It is recommended for large systems.

Rate of convergence

  • Here we don’t mean the asymptotic rate (k → ∞) because CG converges in at most n steps for a quadratic function. But CG can get very close to the solution in quite less than n steps, depending on the eigenvalue structure of A: - If A has only r < n distinct eigenvalues, CG converges in at most n iterations. - If the eigenvalues of A occur in r distinct clusters, CG will approximately solve the problem in r steps (fig. 5.4).
  • Two bounds (using ‖x‖^2 A = xT^ Ax), useful to estimate the convergence rate in advance if we know something about the eigenvalues of A: - ‖xk+1 − x∗‖^2 A ≤

(λ n−k −λ 1 λn−k +λ 1

‖x 0 − x∗‖^2 A if A has eigenvalues λ 1 ≤ · · · ≤ λn.

  • ‖xk − x∗‖A ≤

√κ−^1 κ+

) 2 k ‖x 0 − x∗‖A if κ = λ λn 1 is the c.n. (this bound is very coarse).

Recall that for steepest descent we had a similar expression but with κ κ−+1^1 instead of (√κ− 1 √κ+

  • Preconditioning: change of variables ˆx = Cx so that the new matrix Aˆ = C−T^ AC−^1 has a clustered spectrum or a small condition number (thus faster convergence). Finding good preconditioners C depends on the problem (the structure of A).

Nonlinear conjugate gradient methods

We adapt the linear CG (which minimizes a quadratic function φ) for a nonlinear function f.

Global convergence

  • With restarts and the strong Wolfe conditions, the algorithms (FR, PR) have global con- vergence since they include as a subsequence the steepest descent method (which is globally convergent with the Wolfe conditions).
  • Without restarts:
    • FR has global convergence with the strong Wolfe conditions above.
    • PR does not have global convergence, even though in practice it is better.
  • In general, the theory on the rate of convergence of CG is complex and assumes exact l.s.

Review of conjugate gradient methods

  • Linear CG: An×n sym. pd: solves Ax = b ⇔ φ(x) = min 12 xT^ Ax − bT^ x.
    • {p 0 ,... , pn− 1 } conjugate wrt A ⇔ pTi Apj = 0 ∀ij, pi 6 = 0 ∀i.
    • Finds the solution in at most n steps, each an exact line search along a conjugate direction: xk+1 = xk + αkpk, αk = r

Tk rk pTk Apk ,^ rk^ =^ ∇φ(xk) =^ Axk^ −^ b.

  • At each step, xk is the minimizer over the set x 0 + span {p 0 ,... , pk− 1 }; rk+1 = rk + αkApk; and rTk pi = rTk ri = 0 ∀i < k.
  • Conjugate direction pk is obtained from the previous one and the current gradient: pk = −rk + βkpk− 1 with βk = r

Tk+1rk+ rTk rk.

  • Initial direction is the steepest descent direction p 0 = ∇φ(x 0 ).
  • Space complexity O(n), time complexity O(n^3 ). But often (e.g. when the eigenvalues of A are clustered, or A has low c.n.) it gets very close to the solution in r ≪ n steps, so O(rn^2 ).
  • Nonlinear CG: solves min f (x) where f is nonlinear in general.
  • Fletcher-Reeves: rk = ∇f (xk), αk is determined by an inexact l.s. satisfying the strong Wolfe conditions, βFR k+1 = ∇f^

Tk+1∇fk+ ∇f (^) kT ∇fk. Has global convergence, but to work well in practice it needs restarts (i.e., set βk = 0 every n steps).

  • Polak-Ribi`ere: like FR but β kPR+1 = ∇f^ kT+1(∇fk+1−∇fk^ ) ∇f (^) kT ∇fk. Works better than FR in practice, even though it has no global convergence.
  • In summary, better method than steepest descent, very useful for large n (little storage).

5 Practical Newton methods

  • Newton step: solution of the n × n linear system ∇^2 f (xk)pN k = −∇f (xk).
    • Computing the Hessian is a major task, O(n^2 ).
    • Need to solve the system efficiently.
  • Robustness: two strategies to ensure a good quality step:
    • Newton-CG method: solve the system with the CG method, terminating if negative curvature is encountered; can be implemented as line search or trust region.
  • Efficiency:
    • Newton-CG: inexact Newton step, i.e., terminate the CG iteration before an exact solution is found (don’t need to spend much effort in the subproblem, as in the l.s.).
    • Modified Newton: take advantage of sparsity structure (if available) in the Hessian.
  • In general, these methods become (approximately) the pure Newton step if the Hessian is pd, and otherwise they find a descent direction in some heuristic way.

Inexact Newton steps

Terminate the iterative solver (CG) when the residual rk = ∇^2 f (xk)pk + ∇f (xk) (where pk is the inexact Newton step) is small wrt the gradient (to achieve invariance wrt scalings of f ): ‖rk‖ ≤ ηk ‖∇f (xk)‖ where 0 < ηk ≤ η < 1 ∀k and {ηk} is the forcing sequence:

Rate of convergence

ηk → 0 : superlinear, e.g. ηk = min(0. 5 ,

‖∇f (xk)‖) ηk = O(‖∇f (xk)‖) : quadratic, e.g. ηk = min(0. 5 , ‖∇f (xk)‖)

But the smaller ηk, the more iterations of CG we need.

Newton-CG method

We solve the system with CG method, terminating if negative is encountered (pTk Apk ≤ 0); if the first direction is of negative curvature, use the steepest descent direction instead. (A nd: seeks a maximizer because pTk Apk < 0 ⇒ αk < 0 pk remains descent; A not def.: seeks a saddle, but some directions (pTk Apk = 0) have no stationary points) Then, we use the resulting direction:

  • For a line search (inexact, with appropriate conditions: Wolfe, Goldstein, or Armijo back- tracking line search). Problem: if the Hessian is nearly singular, the Newton-CG direction can be very long.
  • In a trust-region way: limit the line search to a region of the site ∆k.

The method behaves like pure Newton for pd Hessian, like steepest descent for nd Hessian. and finds some descent direction for not definite Hessian.