Gram-Schmidt process with a non-standard inner product and its - - PowerPoint PPT Presentation

gram schmidt process with a non standard inner product
SMART_READER_LITE
LIVE PREVIEW

Gram-Schmidt process with a non-standard inner product and its - - PowerPoint PPT Presentation

Gram-Schmidt process with a non-standard inner product and its application to the approximate inverse preconditioning Miro Rozlo zn k joint work with Ji r Kopal, Alicja Smoktunowicz and Miroslav T uma Institute of Computer


slide-1
SLIDE 1

Gram-Schmidt process with a non-standard inner product and its application to the approximate inverse preconditioning

Miro Rozloˇ zn´ ık joint work with Jiˇ r´ ı Kopal, Alicja Smoktunowicz and Miroslav T˚ uma

Institute of Computer Science, Czech Academy of Sciences, Prague, Czech Republic

Workshop on Structured Preconditioning and Iterative Methods with Applications, Tsinghua Sanya International Mathematics Forum, Sanya, March 24-28, 2014

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 1 / 26

slide-2
SLIDE 2

STANDARD INNER PRODUCT: GRAM-SCHMIDT PROCESS AS QR ORTHOGONALIZATION A = (a1, . . . , an) ∈ Rm,n, m ≥ rank(A) = n

  • rthogonal basis Q of span(A)

Q = (q1, . . . , qn) ∈ Rm,n, QTQ = I A = QR, R upper triangular ATA = RTR

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 2 / 26

slide-3
SLIDE 3

CLASSICAL AND MODIFIED GRAM-SCHMIDT ALGORITHMS finite precision arithmetic: ¯ Q = (¯ q1, . . . ,¯ qn), ¯ QT ¯ Q = In, I − ¯ QT ¯ Q ≤?

◮ classical and modified Gram-Schmidt are mathematically equivalent, but they

have ”different” numerical properties

◮ classical Gram-Schmidt can be ”quite unstable”, can ”quickly” lose all

semblance of orthogonality

◮ Gram-Schmidt with reorthogonalization: ”two-steps are enough” to preserve

the orthogonality to working accuracy

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 3 / 26

slide-4
SLIDE 4

GRAM-SCHMIDT PROCESS VERSUS ROUNDING ERRORS

◮ modified Gram-Schmidt:

assuming O(u)κ(A) < 1 I − ¯ QT ¯ Q ≤

O(u)κ(A) 1−O(u)κ(A)

Bj¨

  • rck, 1967, Bj¨
  • rck, Paige, 1992

◮ classical Gram-Schmidt:

assuming O(u)κ(A) < 1 I − ¯ QT ¯ Q ≤

O(u)κ2(A) 1−O(u)κ(A)

Giraud, van den Eshof, Langou, R, 2005 Barlow, Smoktunowicz, Langou, 2006

◮ classical or modified Gram-Schmidt with reorthogonalization:

assuming O(u)κ(A) < 1 I − ¯ QT ¯ Q ≤ O(u)

Giraud, van den Eshof, Langou, R, 2005 Barlow, Smoktunowicz, 2011

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 4 / 26

slide-5
SLIDE 5

1 2 3 4 5 6 7 8 10

−16

10

−14

10

−12

10

−10

10

−8

10

−6

10

−4

10

−2

10 loss of orthgonality || I − Qk

T Qk ||

logarithm of the condition number κ(Ak) CGS x CHOL QR x MGS x CGS2

Stewart, ”Matrix algorithms” book, p. 284, 1998

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 5 / 26

slide-6
SLIDE 6

ON THE WAY FROM THE STANDARD TO THE NONSTANDARD INNER PRODUCT

◮ Axel Ruhe. Numerical aspects of. Gram-Schmidt orthogonalization. of vectors.

  • Lin. Alg. and its Appl.,. 52/53 (591-601), 1983.

◮ T. Ericsson, An analysis of orthogonalization in elliptic norms, to appear. ◮ M. Gulliksson: Backward error analysis for the constrained and weighted linear

least squares problem when using the weighted QR factorization. SIAM J. Matrix

  • Anal. Appl. 16(2), 675-687 (1995)
  • M. Gulliksson: On the modified GramSchmidt algorithm for weighted and

constrained linear least squares problems. BIT Numer. Math. 35(4), 453-468 (1995)

◮ S.J. Thomas, R.V.M. Zahar: Efficient orthogonalization in the M-norm. Congr.

  • Numer. 80, 23-32 (1991) 36.

S.J. Thomas, R.V.M. Zahar, : An analysis of orthogonalization in elliptic norms.

  • Congr. Numer. 86, 193-222 (1992)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 6 / 26

slide-7
SLIDE 7

ORTHOGONALIZATION WITH A NON-STANDARD INNER PRODUCT B ∈ Rm,m symmetric positive definite, inner product ·, ·B A = [a1, . . . , an] ∈ Rm,n, m ≥ n = rank(A) B-orthogonal basis of the range of A: Z = [z1, . . . , zn] ∈ Rm,n, ZTBZ = I A = ZU, U ∈ Rn,n upper triangular ATBA = UTU

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 7 / 26

slide-8
SLIDE 8

NON-STANDARD ORTHOGONALIZATION AND STANDARD QR B1/2A = (B1/2Z)U, ZTBZ = (B1/2Z)T(B1/2Z) = I κ(Z) ≪ κ1/2(B) κ(U) = κ(B1/2A) ≤ κ1/2(B)κ(A) A = I: Z =

  • U−1
  • ∈ Rm,n upper triangular

κ(U) = κ(Z) = κ1/2(A)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 8 / 26

slide-9
SLIDE 9

Inverse factorization and approximate inverse preconditioning ZZT = AU−1U−TAT = A[ATBA]−1AT

BZZT :

  • rthogonal projector onto R(BA) and orthogonal to R(A)

ZZTB :

  • rthogonal projector onto R(A) and orthogonal to R(BA)

A = I square and nonsingular: inverse factorization ZZT = B−1 Bx = b, approximate inverse ¯ Z¯ ZT ≈ B−1 ↓ ¯ ZTB¯ Zy = ¯ ZTb , x = ¯ Zy, ¯ ZTB¯ Z − I ≤? finite precision arithmetic: ¯ Z = (¯ z1, . . . ,¯ zn), ¯ ZTB¯ Z = I, I − ¯ ZTB¯ Z ≤? ¯ UT ¯ U ≈ ATBA, ATBA − ¯ UT ¯ U ≤? ¯ Z¯ U ≈ A, A − ¯ Z¯ U ≤?

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 9 / 26

slide-10
SLIDE 10

REFERENCE AND GRAM-SCHMIDT IMPLEMENTATIONS B = VΛVT, Λ1/2VTA = QU, Z = VΛ−1/2Q

backward stable eigendecomposition + backward stable QR:

¯ ZTB¯ Z − I ≤ O(u)B¯ Z2 z(0)

i

= ai, z(j)

i

= z(j−1)

i

− ujizj, j = 1, . . . , i − 1 zi = z(i−1)

i

/uii, uii = z(i−1)

i

B

modified Gram-Schmidt ≡ SAINV: uji = z(j−1)

i

, zjB classical Gram-Schmidt: uji = ai, zjB AINV algorithm: uji = z(j−1)

i

, aj/ujjB

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 10 / 26

slide-11
SLIDE 11

CLASSICAL AND MODIFIED GRAM-SCHMIDT ALGORITHMS

classical (CGS) modified (MGS) AINV algorithm for i = 1, . . . , n for i = 1, . . . , n for i = 1, . . . , n z(0)

i

= ai z(0)

i

= ai z(0)

i

= ai for j = 1, . . . , i − 1 for j = 1, . . . , i − 1 for j = 1, . . . , i − 1 z(j)

i

= z(j−1)

i

− ai, zjBzj z(j)

i

= z(j−1)

i

− z(j−1)

i

, zjBzj z(j)

i

= z(j−1)

i

− z(j−1)

i

,

aj z(j−1)

j

B B

end end end zi = z(i−1)

i

/z(i−1)

i

B zi = z(i−1)

i

/z(i−1)

i

B zi = z(i−1)

i

/z(i−1)

i

B end end end

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 11 / 26

slide-12
SLIDE 12

GRAM-SCHMIDT ALGORITHMS WITH COMPLETE REORTHOGONALIZATION

classical (CGS2) modified (MGS2) for i = 1, . . . , n for i = 1, . . . , n z(0)

i

= ai z(0)

i

= ai for k = 1, 2 for k = 1, 2 for j = 1, . . . , i − 1 for j = 1, . . . , i − 1 z(j)

i

= z(j−1)

i

− ai, zjBzj z(j)

i

= z(j−1)

i

− z(j−1)

i

, zjBzj end end end end zi = z(i−1)

i

/z(i−1)

i

B zi = z(i−1)

i

/z(i−1)

i

B end end

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 12 / 26

slide-13
SLIDE 13

CLASSICAL GRAM-SCHMIDT PROVIDES A CHOLESKY FACTOR

Exact arithmetic:

uj,i =

  • ai, zj
  • B

=

  • ai, aj − j−1

k=1 uk,jzk

uj,j

  • B

= ai, ajB − j−1

k=1 uk,iuk,j

uj,j ATBA = UTU

A − ¯ Z¯ U ≤ O(u)¯ Z¯ U ¯ U − ¯ ZTBA ≤ O(u)AB¯ Z

ATBA = ¯ UT ¯ U − (¯ U − ¯ ZTBA)T ¯ U + ATB(A − ¯ Z¯ U)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 13 / 26

slide-14
SLIDE 14

CLASSICAL GRAM-SCHMIDT PROCESS: THE LOSS OF B-ORTHOGONALITY

THE LOSS OF ORTHOGONALITY

ATBA = ¯ UT ¯ U − (¯ U − ¯ ZTBA)T ¯ U + ATB(A − ¯ Z¯ U) ATBA = ¯ UT ¯ ZTB¯ Z¯ U + (A − ¯ Z¯ U)TB¯ Z¯ U + ¯ UT ¯ ZTB(A − ¯ Z¯ U) + (A − ¯ Z¯ U)TB(A − ¯ Z¯ U) ¯ UT(I − ¯ ZTB¯ Z)¯ U = (¯ U − ¯ ZTBA)T ¯ U − (A − ¯ Z¯ U)TB¯ Z¯ U

assuming O(u)κ(B)κ(B1/2A)κ(A) < 1

I − ¯ ZTB¯ Z ≤

O(u)B1/2¯ Zκ(B1/2A)κ1/2(B)κ(A) 1−O(u)B1/2¯ Zκ(B1/2A)κ1/2(B)κ(A)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 14 / 26

slide-15
SLIDE 15

GRAM-SCHMIDT PROCESS WITH REORTHOGONALIZATION (B-CGS2)

z(1)

j

= aj − Zj−1u(1)

1:j−1,j = (I − Zj−1ZT j−1B)aj,

z(2)

j

= z(1)

j

− Zj−1u(2)

1:j−1,j = (I − Zj−1ZT j−1B)2aj = z(1) j

¯ ZT

j−1B

  • ¯

z(2)

j

¯ uj,j

  • I − ¯

ZT

j−1B¯

Zj−12

¯ u1:j−1,j ¯ uj,j

1/uj,j ≤ σ−1

min(U) = σ−1 min(B1/2A), u1:j−1,j/uj,j ≤ κ(B1/2A),

finite precision arithmetic: O(u)κ1/2(B)κ(B1/2A) < 1 I − ¯ ZTB¯ Z ≤ O(u)B¯ Z¯ Z(1)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 15 / 26

slide-16
SLIDE 16

LOSS OF B-ORTHOGONALITY IN GRAM-SCHMIDT

modified Gram-Schmidt:

O(u)κ(B)κ(B1/2A) < 1 I − ¯ ZTB¯ Z ≤ O(u)B¯ Z2κ(B1/2A) 1 − O(u)B¯ Z2κ(B1/2A)

classical Gram-Schmidt and AINV algorithm:

O(u)κ(B)κ(B1/2A)κ(A) < 1 I − ¯ ZTB¯ Z ≤ O(u)B1/2¯ Zκ(B1/2A)κ1/2(B)κ(A) 1 − O(u)B1/2¯ Zκ(B1/2A)κ1/2(B)κ(A)

classical Gram-Schmidt with reorthogonalization:

O(u)κ1/2(B)κ(B1/2A) < 1 I − ¯ ZTB¯ Z ≤ O(u)B¯ Z¯ Z(1)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 16 / 26

slide-17
SLIDE 17

THE LOCAL ERRORS IN A NON-STANDARD INNER PRODUCTS general positive definite B : |fl[¯ z(j−1)

i

,¯ zjB] − ¯ z(j−1)

i

,¯ zjB| ≤ O(u)B¯ z(j−1)

i

¯ zj |1 − ¯ zj2

B| ≤ O(u)B¯

zj2 diagonal positive (weight matrix) B : |fl[¯ z(j−1)

i

,¯ zjB] − ¯ z(j−1)

i

,¯ zjB| ≤ O(u)¯ z(j−1)

i

B¯ zjB |1 − ¯ zj2

B| ≤ O(u)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 17 / 26

slide-18
SLIDE 18

DIAGONAL CASE IS SIMILAR TO STANDARD CASE

modified Gram-Schmidt: O(u)κ(B1/2A) < 1 I − ¯ ZTB¯ Z ≤ O(u)κ(B1/2A) 1 − O(u)κ(B1/2A) classical Gram-Schmidt and AINV algorithm O(u)κ2(B1/2A) < 1 I − ¯ ZTB¯ Z ≤ O(u)κ2(B1/2A) 1 − O(u)κ2(B1/2A) classical Gram-Schmidt with reorthogonalization: O(u)κ(B1/2A) < 1 I − ¯ ZTB¯ Z ≤ O(u)

Gulliksson, Wedin 1992, Gulliksson 1995

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 18 / 26

slide-19
SLIDE 19

NUMERICAL EXPERIMENTS - EXTREMAL CASES

  • 1. κ1/2(B) ≪ κ(B1/2A)
  • 2. κ(B1/2A) ≤ κ1/2(B)
  • 3. B positive diagonal

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 19 / 26

slide-20
SLIDE 20

10 10

2

10

4

10

6

10

8

10

10

10

12

10

14

10

16

10

−16

10

−14

10

−12

10

−10

10

−8

10

−6

10

−4

10

−2

10 Loss of orthogonality ||I−ZTAZ|| condition number (A1/2 Z(0)) Problem 9 (Hilbert matrix), κ(A) = 1.2e5

MGS CGS CGS2 AINV EIG u κ(A) u κ(A) κ(A1/2Z(0)) u κ(A) κ(A1/2Z(0)) κ(Z(0)) Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 20 / 26

slide-21
SLIDE 21

10 10

2

10

4

10

6

10

8

10

10

10

12

10

14

10

16

10

−16

10

−14

10

−12

10

−10

10

−8

10

−6

10

−4

10

−2

10 Loss of orthogonality ||I−ZTAZ|| condition number (A) Problem 11 (Hilbert matrix) MGS CGS CGS2 AINV EIG u κ(A) u κ(A) κ(A1/2Z(0)) u κ(A) κ(A1/2Z(0)) κ(Z0)

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 21 / 26

slide-22
SLIDE 22

10 10

2

10

4

10

6

10

8

10

10

10

12

10

14

10

16

10

−16

10

−14

10

−12

10

−10

10

−8

10

−6

10

−4

10

−2

10 Loss of orthogonality ||I−ZTAZ|| condition number (A) Problem 3 (diagonal matrix) MGS CGS CGS2 AINV EIG u κ(A1/2Z(0)) u κ2(A1/2 Z(0))

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 22 / 26

slide-23
SLIDE 23

ON THE WAY FROM THE INNER PRODUCT TO THE BILINEAR FORM

◮ Symmetric indefinite eigenvalue problems. The bilinear form x, yB = yTBx can

have x, xB < 0 and x, xB = 0 for some x = 0.

◮ Eigenvectors Q can be chosen such that QTBQ = Ω where Ω = diag(±1) is a

signature matrix. Isotropic vectors xTBx = 0.

◮ Structured eigenvalue problems. The SR factorization. The skew-symmetric

bilinear form x, yB = yTBx, where BT = −B. Each vector satisfies xTBx = 0.

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 23 / 26

slide-24
SLIDE 24

INDEFINITE ORTHOGONALIZATION WITH A SYMMETRIC BILINEAR FORM B ∈ Rm,m symmetric indefinite and nonsingular, bilinear form A = (a1, . . . , an) ∈ Rm,n, m ≥ n = rank(A) B-orthonormal basis of span(A): Q = (q1, . . . , qn) ∈ Rm,n, QTBQ = Ω ∈ diag(±1) A = QR, R ∈ Rn,n upper triangular with positive diagonal if no principal minor of ATBA vanishes (if ATBA is strongly nonsingular)

ATBA = RTΩR

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 24 / 26

slide-25
SLIDE 25

GRAM-SCHMIDT WITH SKEW-SYMMETRIC BILINEAR FORM: SR FACTORIZATION B =

  • Im

−Im

  • ∈ R2m,2m skew-symmetric and orthogonal

A = [a1, a2] ∈ R2m,2, non-isotropic with aT

1Ba2 = 0

V = [v1, v2] ∈ R2m,2, symplectic VBV =

  • −1

1

  • VTBV = I2,

vT

1Bv2 = 1

A = VR, R =

  • r11

r12 r22

  • ∈ R2,2 upper triangular with r11r22 = aT

1Ba2

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 25 / 26

slide-26
SLIDE 26

Thank you for your attention!!!

References: R, J. Kopal, M. Tuma, A. Smoktunowicz: Numerical stability of

  • rthogonalization methods with a non-standard inner product, BIT Numerical

Mathematics (2012) 52:1035-1058. R, F. Okulicka-Dluzewska, A. Smoktunowicz: Indefinite orthogonalization with rounding errors, submitted 2013.

Miro Rozloˇ zn´ ık (Prague) Gram-Schmidt orthogonalization: rounding error analysis TSIMF, Sanya, 2014 26 / 26