Docsity

Numerical Linear Algebra Background-Optimization Techniques and Methods-Lecture Slides, Slides of Convex Optimization

Partial preview of the text

Download Numerical Linear Algebra Background-Optimization Techniques and Methods-Lecture Slides and more Slides Convex Optimization in PDF only on Docsity!

Convex Optimization — Boyd & Vandenberghe

9. Numerical linear algebra background

-^ matrix structure and algorithm complexity •^ solving linear equations with factored matrices •^ LU, Cholesky, LDL

T^ factorization

-^ block elimination and the matrix inversion lemma •^ solving underdetermined equations

Matrix structure and algorithm complexity

cost (execution time) of solving

Ax

=^ b

with

A^ ∈

n R ×n

-^ for general methods, grows as

(^3) n

-^ less if

A^ is structured (banded, sparse, Toeplitz,... ) flop counts^ •^ flop (floating-point operation): one addition, subtraction,multiplication, or division of two floating-point numbers^ •^ to estimate complexity of an algorithm: express number of flops as a(polynomial) function of the problem dimensions, and simplify bykeeping only the leading terms^ •^ not an accurate predictor of computation time on modern computers^ •^ useful as a rough estimate of complexity Numerical linear algebra background

Linear equations that are easy to solve

diagonal matrices

(aij

if^ i

6 =^ j

):^ n

flops

x^ =

− A

1 b^ = (

b/a^1

,... , b 11

/an

)nn

lower triangular

(aij

if^ j > i

):^ n

2 flops

x^1

:=^

b/a^1

11

x^2

:=^

(b^2 −^ a

x 211 )/a^22

x^3

:=^

(b^3 −^ a

x 311 −^ a

x 322 )/a 33

xn^

:=^

(bn^

−^ a

xn 1

−^1

an^2 x− · · · −^2

an,n

x− 1 n−^1

)/a nn

called forward substitution upper triangular

(aij

if^ j < i

):^ n

2 flops via backward substitution

Numerical linear algebra background

orthogonal matrices:

− A

T A

•^2

(^2) nflops to compute

x^ =

T A

b^ for general

A

-^ less with structure,

e.g.

, if^

A^ =

I^ −

2 uu

T^ with

‖u‖

, we can

compute

x^ =

T A

b^ =

b^ −

2(u

T^ b)u

in^4

n^ flops

permutation matrices:

aij^

j^ =

πi 0 otherwise

where

π^ = (

π, π^1

,... , π 2

)^ is a permutation ofn

2 ,... , n

-^ interpretation:

Ax

x,... , xπ^1

)πn

-^ satisfies

− A

T A

, hence cost of solving

Ax

=^ b

is 0 flops

example:

A^ =

^0 ^

,^

−^1 A

=^ A

T^ =

^0 ^

Numerical linear algebra background

LU factorization

every nonsingular matrix

A^ can be factored as

A^ =

P LU

with

P^

a permutation matrix,

L^ lower triangular,

U^

upper triangular

cost:

3)n 3 flops Solving linear equations by LU factorization. given

a set of linear equations

Ax

=^ b

, with

A^ nonsingular.

1.^ LU factorization.

Factor

A^ as

A^ =

P LU

((

/3)n

3 flops).

2.^ Permutation.

Solve

P z

=^1 b^ (^0

flops).

3.^ Forward substitution.

Solve

Lz^2

=^ z

(n 1 2 flops).

4.^ Backward substitution.

Solve

U x

=^ z

(n 2 2 flops).

cost:

3)n

(^2) n≈

3)n

3 for large

n

Numerical linear algebra background

sparse LU factorization

A^ =

PLU P^1

2

-^ adding permutation matrix

P^2

offers possibility of sparser

L,^

U^ (hence,

cheaper factor and solve steps) • Pand^1

P^2

chosen (heuristically) to yield sparse

L,^

U

-^ choice of

P^1

and

P^2

depends on sparsity pattern and values of

A

-^ cost is usually much less than

3)n

3 ; exact value depends in a

complicated way on

n, number of zeros in

A, sparsity pattern

Numerical linear algebra background

sparse Cholesky factorization

A^ =

P LL

T^ TP^

-^ adding permutation matrix

P^

offers possibility of sparser

L

•^ P

chosen (heuristically) to yield sparse

L

-^ choice of

P^

only depends on sparsity pattern of

A^ (unlike sparse LU)

-^ cost is usually much less than

3)n

3 ; exact value depends in a

complicated way on

n, number of zeros in

A, sparsity pattern

Numerical linear algebra background

LDL

T^ factorization

every nonsingular symmetric matrix

A^ can be factored as A^ =

P LDL

T^ TP^

with

P^

a permutation matrix,

L^ lower triangular,

D^

block diagonal with

1 ×

1 or

2 ×

2 diagonal blocks

cost:

3)n 3

-^ cost of solving symmetric sets of linear equations by LDL

T^ factorization:

(^3) n+ 2

(^2) n≈

3)n

3 for large

n

-^ for sparse

A, can choose

P^

to yield sparse

L; cost

≪^

(^3) n

Numerical linear algebra background

dominant terms in flop count^ •^ step 1:

f^ +

ns^2

(f^

is cost of factoring

A^11

;^ s^ is cost of solve step)

-^ step 2:

2 n

2 n^1

(cost dominated by product of

A^21

and

− A

1 A^1211

-^ step 3:

3)n

32

total:

f^ +

ns^2

(^2) nn 2

/3)n

32

examples^ •^ general

A^11

(f^

/3)n

3 ,^ s 1

(^2) n): no gain over standard method 1

#flops

/3)n

(^2) nn 1

(^2) nn 2

/3)n

n+^1

n)^2

3

-^ block elimination is useful for structured

A^11

(f^ ≪^ n

for example, diagonal (

f^ = 0

,^ s^ =

n): #flops^1

≈^2

(^2) nn 2

/3)n

32

Numerical linear algebra background

Structured matrix plus low rank term

(A^ +

BC

)x^ =

b

•^ A

∈^ R

n×n

,^ B^

∈^ R

n×p

,^ C^

∈^ R

p×n

-^ assume

A^ has structure (

Ax^

=^ b

easy to solve)

first write as

[^ A

B C −

] [ I

x y

]^ =

[^ b^0

]

now apply block elimination: solve

(I^ +

CA

−^1 B

)y^ =

CA

−^1 b,

then solve

Ax

=^ b

−^ By

this proves the

matrix inversion lemma:

if^ A

and

A^ +

BC

nonsingular,

(A^ +

BC

−^1 )

=^ A

−^1 −

− A

1 B(

I^ +

CA

−^1 B

−^1 )

CA

−^1

Numerical linear algebra background

Underdetermined linear equations

if^ A

∈^ R

p×n

with

p < n

,^ rank

A^ =

p,

{x^ |

Ax

=^ b

}^ =

{F z

  • ˆx

|^ z^

∈^ R

n−p

-^ ˆx

is (any) particular solution

-^ columns of

F^ ∈

n R ×(n−

p)^ span nullspace of

A

-^ there exist several numerical methods for computing

F

(QR factorization, rectangular LU factorization,... ) Numerical linear algebra background