Docsity

Introduction to Conjugate Gradient Methods for Linear Systems and Optimization - Prof. P. , Study notes of Mathematics

Partial preview of the text

Download Introduction to Conjugate Gradient Methods for Linear Systems and Optimization - Prof. P. and more Study notes Mathematics in PDF only on Docsity!

Numerical Optimization

Lecture Notes # Conjugate Gradient Methods — Linear CG, Part #

Peter Blomgren, 〈[email protected]〉 Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center San Diego State University San Diego, CA 92182- http://terminus.sdsu.edu/

Fall 2009

Outline

(^1) Recap

(^2) Conjugate Gradient Methods Introduction

Conjugate Gradient Methods: Introduction

For short: “CG” Methods. — One of the most useful techniques for solving large linear systems of equations A˜x = ˜b. “Linear CG” — Can be adopted to solve nonlinear optimization problems. “Nonlinear CG” (Our type of problems!)

— Linear CG is an alternative to Gaussian elimination (well suited for large problems). — Performance of linear CG is strongly tied to the distribution of the eigenvalues of A.

First, we explore the Linear CG method...

The Linear CG Method Language and Notation

The linear CG method is an iterative method for solving linear systems of equations

A˜x = ˜b, A ∈ Rn×n, ˜x ∈ Rn, ˜b ∈ Rn

where the matrix A is symmetric positive definite. Notice that this problem is equivalent to minimizing Φ(˜x) where

Φ(˜x) = 1 2 ˜x

T (^) A˜x − ˜bT (^) ˜x + c

since ∇Φ(˜x) = A˜x − ˜b def = ˜r(˜x)

We refer to ˜r(˜x) as the residual of the linear system. Note that if ˜x∗^ = A−^1 ˜b, then ˜r(˜x∗) = 0, i.e. the residual is a measure of how close (or far) we are from solving the linear system.

Conjugate Direction Method ( != CG Method ) 1 of 4

Given a starting point ˜x 0 ∈ Rn, and a set of conjugate directions {˜p 0 , ˜p 1 ,... , ˜pn} we generate a sequence of points ˜xk ∈ Rn^ by setting ˜xk+1 = ˜xk + αk ˜pk

where αk is the minimizer of the quadratic function ϕ(α) = Φ(˜xk + α˜pk ), i.e. the minimizer of Φ(·) along the line ˜l(α) = ˜xk + α˜pk.

We have already solved this problem — in the context of step-length selection for line search methods, see lecture #6 — so we “know” that the optimizer is given by

αk = −

˜rTk ˜pk ˜pTk A˜pk

, where ˜rk = ˜r(˜xk )

Conjugate Direction Method ( != CG Method ) 2 of 4

Theorem For any ˜x 0 ∈ Rn^ the sequence {˜xk } generated by the conjugate direction algorithm converges to the solution ˜x∗^ of the linear system in at most n steps.

The proof indicates how properties of CG are found...

Proof: Part 1.

Conjugate Direction Method ( != CG Method ) 3 of 4

Proof: Part 2. If we are generating ˜xk by the conjugate direction method, then we have

˜xk = ˜x 0 + α 0 ˜p 0 + α 1 ˜p 1 + · · · + αk− 1 ˜pk− 1

Conjugate Direction Method ( != CG Method ) 3 of 4

Proof: Part 2. If we are generating ˜xk by the conjugate direction method, then we have

˜xk = ˜x 0 + α 0 ˜p 0 + α 1 ˜p 1 + · · · + αk− 1 ˜pk− 1

we multiply this by ˜pTk A

˜pTk A˜xk = p˜Tk A [˜x 0 + α 0 ˜p 0 + α 1 ˜p 1 + · · · + αk− 1 ˜pk− 1 ]

Conjugate Direction Method ( != CG Method ) 3 of 4

Proof: Part 2. If we are generating ˜xk by the conjugate direction method, then we have

˜xk = ˜x 0 + α 0 ˜p 0 + α 1 ˜p 1 + · · · + αk− 1 ˜pk− 1

we multiply this by ˜pTk A

˜pTk A˜xk = p˜Tk A [˜x 0 + α 0 ˜p 0 + α 1 ˜p 1 + · · · + αk− 1 ˜pk− 1 ]

using the conjugacy property, we see that all but the first term on the right-hand-side are zero:

˜pTk A˜xk = ˜pTk A˜x 0 ⇔ ˜pTk A(˜xk − ˜x 0 ) = 0 Now we have ˜pTk A(˜x∗^ − ˜x 0 ) = ˜pTk A(˜x∗^ − ˜x 0 − ( |˜x k −{z ˜x 0 )} adds 0

) = ˜pTk A(˜x∗^ − ˜xk ) = ˜pTk (˜b − A˜xk ) = −˜pTk ˜rk

Conjugate Direction Method ( != CG Method ) 4 of 4

We have shown ˜pTk A(˜x∗^ − ˜x 0 ) = −˜pTk ˜rk

Now, we notice that the right-hand-side is the numerator in αk

αk =

−˜pTk ˜rk ˜pTk Ap˜k

Conjugate Direction Method ( != CG Method ) 4 of 4

We have shown ˜pTk A(˜x∗^ − ˜x 0 ) = −˜pTk ˜rk

Now, we notice that the right-hand-side is the numerator in αk

αk =

−˜pTk ˜rk ˜pTk Ap˜k We conclude to proof by showing that the left-hand-side is the numerator in and expression for σk (with the same denominator); we premultiply the expression for (˜x∗^ − ˜x 0 ) by p˜Tk A and obtain

˜pTk A(˜x∗^ − ˜x 0 ) = ˜pTk A

n∑− 1

i=

σi ˜pi =

n∑− 1

i=

σi ˜pTk A˜pi = σk ˜pTk A˜pk

Hence, σk =

˜pTk A(˜x∗^ − ˜x 0 ) ˜pTk Ap˜k

Conjugate Direction Method: Comments and Interpretation 1 of 2

Most of the proofs regarding CD and CG methods are argued in a similar way — by looking at optimizers and residuals over sub-spaces of Rn^ spanned by some subset of a set of conjugate vectors.

−5 −5 −4 −3 −2 −1 0 1 2 3 4 5

−

−

−

−

0

1

2

3

4

5

Interpretation: If the matrix A is diagonal, then the contours of Φ(˜x) are ellipses whose axes are aligned with the coordinate directions. In this case, we can find the minimizer by performing 1D-minimizations along the coordinate directions ˜e 1 , ˜e 2 ,... , ˜en in turn.

Recovering n-step Convergence for Non-Diagonal A 1 of 2

For non-diagonal matrices A, the n-step convergence can be recovered by transforming the problem. Let S ∈ Rn×n^ be a matrix with conjugate columns, i.e. if {˜p 0 , ˜p 1 ,... , ˜pn− 1 } is a set of conjugate directions (with respect to A), then

S =

˜p 0 ˜p 1 · · · ˜pn− 1 || || ||

We introduce a new variable ̂x = S−^1 ˜x, and thus get the new quadratic objective which can be minimized in n steps

Φ(̂ ̂x) = Φ(S ̂x) =^1 2

xT^ (ST^ AS) ︸ ︷︷ ︸ Diagonal

̂ x − (ST^ ˜b)T^ ̂x

Recovering n-step Convergence for Non-Diagonal A 2 of 2

We note that the matrix (ST^ AS) is diagonal by the conjugacy property, and that each coordinate direction ˜ei in ̂x-space corresponds to the direction ˜pi− 1 in ˜x-space. When the matrix is diagonal, each coordinate minimization determines one of the components of the solution ˜x∗. Hence, after k iterations, the quadratic has been minimized on the subspace spanned by ˜e 1 , ˜e 2 ,... , ˜ek. If we instead minimize along the conjugate directions, then after k iterations, the quadratic has been minimized on the subspace spanned by ˜p 0 , ˜p 1 ,... , ˜pk− 1.