31
A Matrix-Free, Transpose-Free Norm Estimator Ilse Ipsen Department of Mathematics North Carolina State University Raleigh, USA Joint work with Alina Chertock, Pierre Gremaud, Tim Kelley IMA – p.1

A Matrix-Free, Transpose-Free Norm Estimator

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Matrix-Free, Transpose-Free Norm Estimator

A Matrix-Free, Transpose-FreeNorm Estimator

Ilse Ipsen

Department of Mathematics

North Carolina State University

Raleigh, USA

Joint work with Alina Chertock, Pierre Gremaud, Tim Kelley

IMA – p.1

Page 2: A Matrix-Free, Transpose-Free Norm Estimator

Motivation

Flow in unsaturated porous media[Kelley, Kees, Miller, Tocci, 1998]

• Solution of DAE F (x) = 0by Newton iterative method

• To decide whether to update Jacobianneed to estimate ‖A‖, where A = [F ′(x)]−1

• A is sparse• A only accessible as matvec Ax

• Transpose of A not available

IMA – p.2

Page 3: A Matrix-Free, Transpose-Free Norm Estimator

Conventional Norm Estimation

Given: real square matrix AWant: estimate of ‖A‖

• p-norm power method estimatorGeneralizes power method on AT A

• LAPACK 1-norm estimatorImprovement of 1-norm power methodestimator

• LINPACK-type estimatorsRequire factorization of A

IMA – p.3

Page 4: A Matrix-Free, Transpose-Free Norm Estimator

Statistical Norm Estimation

A is real n × n matrixz is uniformly distributed on unit n-sphere

Dixon 1983: A symmetric positive definite

Prob(

zT Az ≥ ǫ‖A‖2

)

≥ 1 − .8√

Kuczynski & Wozniakowski 1992

Gudmundsson, Kenney & Laub 1995:

E(

n‖Az‖22

)

= ‖A‖2F

Kenney, Laub & Reese 1998: ‖A−1‖F IMA – p.4

Page 5: A Matrix-Free, Transpose-Free Norm Estimator

Generating Random Vectors

y =(

y1 . . . yn

)T

yi are independent normal (0, 1)

‖y‖2 =(∑n

i=1 |yi|2)1/2

y/‖y‖2 uniformly distributed on unit n-sphere

Matlab: y=randn(n,1); z=y/norm(y)

Devroye 1986Calafiore, Dabbene & Tempo 1999

IMA – p.5

Page 6: A Matrix-Free, Transpose-Free Norm Estimator

Main Idea

z =(

z1 . . . zn

)T

uniformly distributed on unit n-sphere

Prob

(

k∑

i=1

z2i ≤ ǫ2

)

=B(a, b, ǫ2)

B(a, b, 1)

where a = k2, b = n−k

2

B(a, b, x) =

∫ x

0

ta−1(1 − t)b−1dt

Jessup & Ipsen 1992, Kenney & Laub 1994 IMA – p.6

Page 7: A Matrix-Free, Transpose-Free Norm Estimator

Vector Norm Estimation

Kenney & Laub: ‖v‖2 = E(|vT z|)/En

En =

{

(n−2)!!(n−1)!!

if n odd2π

(n−2)!!(n−1)!!

if n even

Prob

(

ǫ‖v‖2 ≤ |vT z|En

≤ ‖v‖2

ǫ

)

≥ 1 − ǫ

(

2

π+ 4e−1/(4ǫ2)

)

IMA – p.7

Page 8: A Matrix-Free, Transpose-Free Norm Estimator

Our Bounds

P = Prob(

|vT z| ≤ ǫ‖v‖2

)

ǫ1

n − 2

n − 3erf

(

ǫn1

ǫ1

)

≤ P ≤√

n − 1

n − 3erf (ǫn1)

where

erf(x) = 2√π

∫ x

0 e−t2dt

n1 =√

n−32

, ǫ1 =√

1 − ǫ2

IMA – p.8

Page 9: A Matrix-Free, Transpose-Free Norm Estimator

Probabilities for larger n

If n ≥ 1000 then

Prob(√

n|vT z| ≤ 3‖v‖2

)

≈ .99

Prob

(√n|vT z| ≥

‖v‖2

100

)

≈ .92

With high probability√

n|vT z| ≈ µ‖v‖2, 10−2 ≤ µ ≤ 3

IMA – p.9

Page 10: A Matrix-Free, Transpose-Free Norm Estimator

Matrix Frobenius Norm Estimation

A is n × n real matrix

‖A‖F =

n∑

i,j=1

|aij|2

1/2

Two approaches:

• Treat A as a vector: ‖A‖F = ‖ vec(A)‖2

• Approximate ‖A‖F by matrix vector products

IMA – p.10

Page 11: A Matrix-Free, Transpose-Free Norm Estimator

First Approach

‖A‖F = ‖ vec(A)‖2

vec(A) is 1 × n2

z is uniformly distributed on unit n2-sphere

Prob (| vec(A)z| ≤ ǫ‖A‖F )=B(a, b, ǫ2)

B(a, b, 1)

where a = 12, b = n2−1

2

B(a, b, x) =

∫ x

0

ta−1(1 − t)b−1dt

IMA – p.11

Page 12: A Matrix-Free, Transpose-Free Norm Estimator

Probabilities for larger n

If n ≥ 1000 then

Prob (n| vec(A)z| ≤ 3‖A‖F ) ≈ .99

Prob

(

n| vec(A)z| ≥‖A‖F

100

)

≈ .92

With high probability

n| vec(A)z| ≈ µ‖A‖F , 10−2 ≤ µ ≤ 3

IMA – p.12

Page 13: A Matrix-Free, Transpose-Free Norm Estimator

Second Approach

Use matrix vector product ‖Az‖2

z is uniformly distributed on unit n-sphere

Prob (‖Az‖2 ≤ ǫ‖A‖F )≥ B(a, b, ǫ2)

B(a, b, 1)

Prob (‖Az‖2 ≥ ǫ‖A‖F )≥ 1 − B(a, b, ǫ2)

B(a, b, 1)

where a = 12, b = n−1

2

IMA – p.13

Page 14: A Matrix-Free, Transpose-Free Norm Estimator

Probabilities for larger n

If n ≥ 1000 then

Prob(√

n‖Az‖2 ≤ 3‖A‖F

)

≥ .99

Prob

(√n‖Az‖2 ≥

‖A‖F

100

)

≥ .92

With high probability√

n‖Az‖2 ≈ µ‖A‖F , 10−2 ≤ µ ≤ 3

IMA – p.14

Page 15: A Matrix-Free, Transpose-Free Norm Estimator

Experiments

• Matrix dimension n = 1000

• Matvec:‖A‖F ≈ √

n‖Az‖2 where z is n × 1

• Vec:‖A‖F ≈ n| vec(A)z| where z is n2 × 1

• 100 tries for each matrix• Display:

√n‖Az‖2

‖A‖F

n| vec(A)z|‖A‖F

IMA – p.15

Page 16: A Matrix-Free, Transpose-Free Norm Estimator

Grcar Matrix

0 0.5 1 1.5 2 2.50

10

20

30

40

50

60

70MatvecVec

IMA – p.16

Page 17: A Matrix-Free, Transpose-Free Norm Estimator

Orthogonal Matrix

0 0.5 1 1.5 2 2.5 3 3.50

10

20

30

40

50

60

70

80

90

100MatvecVec

IMA – p.17

Page 18: A Matrix-Free, Transpose-Free Norm Estimator

Cauchy Matrix

0 0.5 1 1.5 2 2.5 30

5

10

15

20

25

30

35MatvecVec

IMA – p.18

Page 19: A Matrix-Free, Transpose-Free Norm Estimator

Hilbert Matrix

0 0.5 1 1.5 2 2.5 3 3.50

5

10

15

20

25

30MatvecVec

IMA – p.19

Page 20: A Matrix-Free, Transpose-Free Norm Estimator

Experiments

Matrix Vec MatvecGrcar [.01, 2.3] [.96, 1.04]

Randn [.004, 3.2] [.94, 1.1]

Orthog [.005, 2.7] [1, 1]

Chebvand [.01, 3.1] [.94, 1.06]

Hilbert [.001, 2.1] [.21, 2.2]

Cauchy [.01, 2.9] [.18, 2.3]

Rand [.002, 2.9] [.49, 1.9]

Clement [.003, 2.7] [.98, 1.02]

Chebspec [.01, 2.5] [.29, 2.5]

IMA – p.20

Page 21: A Matrix-Free, Transpose-Free Norm Estimator

Matvec vs. Vec

Experiments suggest:

• ‖A‖F ≈ √n‖Az‖2

• more accurate• easier to compute (1 matvec)

• Vec: ‖A‖F ≈ n| vec(A)z|• less accurate• tends to underestimate more

IMA – p.21

Page 22: A Matrix-Free, Transpose-Free Norm Estimator

Several Samples

A is a n × n real matrix• z uniformly distributed on unit n-sphere

‖A‖F ≈√

n‖Az‖F

• Z is n × m “random” matrix with orthonormalcolumns

‖A‖F ≈√

n

m‖AZ‖F

“Projection” on a subspaceIMA – p.22

Page 23: A Matrix-Free, Transpose-Free Norm Estimator

Orthogonal Random Matrices

Birkhoff & Gulati 1979Stewart 1980Anderson, Olkin & Underhill 1987

• X is n × m, xij independent normal (0,1)

• Columns of X lin. indep. (with probability 1)• QR decomposition

X = ZR, Z∗Z = Im, Rii > 0

• Z is invariantly distributed

IMA – p.23

Page 24: A Matrix-Free, Transpose-Free Norm Estimator

Experiments

• Tridiagonal matrices of order n = 1000

• Matlab randsvd5 different singular value distributions

• Condition numbers: ‖A‖2‖A−1‖2 = 1016

• # samples: m = 1, 2, 3

• 100 tries for each matrix and sample• Display:

n

m

‖AZ‖F

‖A‖F

m = 1, 2, 3

IMA – p.24

Page 25: A Matrix-Free, Transpose-Free Norm Estimator

Singular Value Distributions

Singular values σ1 ≥ . . . ≥ σn

Condition number κ = σ1/σn

• One large singular value:σ1 = 1, all other σi = 1/κ

• One small singular value:σn = 1/κ, all other σi = 1

• Geometrically distributed singular values:σi = κ−(i−1)/(n−1)

IMA – p.25

Page 26: A Matrix-Free, Transpose-Free Norm Estimator

One Large Singular Value

0 0.5 1 1.5 2 2.50

5

10

15

20

25m=3m=2m=1

IMA – p.26

Page 27: A Matrix-Free, Transpose-Free Norm Estimator

One Small Singular Value

0.996 0.9965 0.997 0.9975 0.998 0.9985 0.999 0.9995 1 1.00050

10

20

30

40

50

60

70m=3m=2m=1

IMA – p.27

Page 28: A Matrix-Free, Transpose-Free Norm Estimator

Geometrically Distributed SValues

0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.60

5

10

15

20

25

30

35

40m=3m=2m=1

IMA – p.28

Page 29: A Matrix-Free, Transpose-Free Norm Estimator

Many Samples: m = 1, 10, 20

0.7 0.8 0.9 1 1.1 1.2 1.30

10

20

30

40

50

60m=20m=10m=1

IMA – p.29

Page 30: A Matrix-Free, Transpose-Free Norm Estimator

Performance of√

nm

‖AZ‖F

Experiments suggest:

• A few samples (m ≤ 5) do not help much• Many samples (m ≥ 10) can help more• Sensitive to singular value distribution• If A has many large singular values of similar

magnitude then for m = 1

√n‖Az‖2 ≈ (1 ± 10−2)‖A‖F

IMA – p.30

Page 31: A Matrix-Free, Transpose-Free Norm Estimator

Summary

• Statistical norm estimation• ‖A‖F ≈ √

n‖Az‖2

A is n × nz uniformly distributed on unit n-sphere

• With high probability for n ≥ 1000

√n‖Az‖2 ≈ µ‖A‖F , 10−2 ≤ µ ≤ 3

• Works well if A has many large singular values

• m samples: ‖A‖F ≈√

nm

‖AZ‖F

Significant improvements only for large mIMA – p.31