Clever Geek Handbook
📜 ⬆️ ⬇️

QR algorithm

The QR algorithm is a numerical method in linear algebra designed to solve the complete eigenvalue problem, that is, to find all eigenvalues ​​and eigenvectors of the matrix . It was developed in the late 1950s independently by V.N. Kublanovskaya and J. Francis.

Let A be a real matrix for which we want to find eigenvalues ​​and vectors. Put A 0 = A. At the kth step (starting from k = 0), we calculate the QR decomposition A k = Q k R k , where Q k is the orthogonal matrix (i.e., Q k T = Q k −1 ), and R k is the upper triangular matrix . Then we define A k +1 = R k Q k .

notice, that

Ak+one=RkQk=Qk-oneQkRkQk=Qk-oneAkQk=QkTAkQk,{\ displaystyle A_ {k + 1} = R_ {k} Q_ {k} = Q_ {k} ^ {- 1} Q_ {k} R_ {k} Q_ {k} = Q_ {k} ^ {- 1} A_ {k} Q_ {k} = Q_ {k} ^ {T} A_ {k} Q_ {k},} {\ displaystyle A_ {k + 1} = R_ {k} Q_ {k} = Q_ {k} ^ {- 1} Q_ {k} R_ {k} Q_ {k} = Q_ {k} ^ {- 1} A_ {k} Q_ {k} = Q_ {k} ^ {T} A_ {k} Q_ {k},}

that is, all matrices A k are similar , that is, their eigenvalues ​​are equal.

Suppose that all diagonal minors of the matrix A are not degenerate . Then the sequence of matrices A k as k → ∞ converges in shape to the cellular right triangular form corresponding to cells with identical eigenvalues ​​modulo same. [one]

In order to obtain the eigenvectors of the matrix, we need to multiply all the matrices Q k .

Aglorhythm is considered computationally stable , because produced by orthogonal similarity transformations.

Proof for a symmetric positive definite matrix

We assume that the eigenvalues ​​of a positive definite matrix A are ordered in descending order:

λone>λ2>...>λn>0.{\ displaystyle \ lambda _ {1}> \ lambda _ {2}> ...> \ lambda _ {n}> 0.} {\displaystyle \lambda _{1}>\lambda _{2}>...>\lambda _{n}>0.}

Let be

Λ=diag(λone,...,λn),{\ displaystyle \ Lambda = \ mathrm {diag} \ left (\ lambda _ {1}, ..., \ lambda _ {n} \ right),} {\displaystyle \Lambda =\mathrm {diag} \left(\lambda _{1},...,\lambda _{n}\right),}

and S is a matrix composed of eigenvectors of the matrix A. Then, matrix A can be written as spectral decomposition

A=SΛST.{\ displaystyle A = S \ Lambda S ^ {T}.} {\displaystyle A=S\Lambda S^{T}.}

We find an expression for the powers of the original matrix in terms of the matrices Q k and R k . On the one hand, by the definition of the QR algorithm:

Ak=Aonek=(QoneRone)k=Qone(RoneQone)k-oneRone=QoneA2k-oneRone.{\ displaystyle A ^ {k} = A_ {1} ^ {k} = \ left (Q_ {1} R_ {1} \ right) ^ {k} = Q_ {1} \ left (R_ {1} Q_ { 1} \ right) ^ {k-1} R_ {1} = Q_ {1} A_ {2} ^ {k-1} R_ {1}.}  

Applying this relation recursively, we obtain:

Ak=Qone⋅...⋅Qk⋅Rk⋅...⋅Rone{\ displaystyle A ^ {k} = Q_ {1} \ cdot ... \ cdot Q_ {k} \ cdot R_ {k} \ cdot ... \ cdot R_ {1}}  

By entering the following notation:

Sk=Qone⋅...⋅Qk,{\ displaystyle S_ {k} = Q_ {1} \ cdot ... \ cdot Q_ {k},}  
Tk=Rk⋅...⋅Rone,{\ displaystyle T_ {k} = R_ {k} \ cdot ... \ cdot R_ {1},}  

we get

Ak=SkTk.{\ displaystyle A ^ {k} = S_ {k} T_ {k}.}  

On the other hand:

Ak=SΛkST.{\ displaystyle A ^ {k} = S \ Lambda ^ {k} S ^ {T}.}  

Equating the right sides of the last two formulas, we obtain:

SΛkST=SkTk.{\ displaystyle S \ Lambda ^ {k} S ^ {T} = S_ {k} T_ {k}.}  

Suppose that there is an LU decomposition of the matrix S T :

ST=LU,{\ displaystyle S ^ {T} = LU,}  

then

SΛkLU=SkTk.{\ displaystyle S \ Lambda ^ {k} LU = S_ {k} T_ {k}.}  

We multiply on the right by the matrix inverse to U , and then by the inverse to Λ k :

SΛkL=SkTkU-one,{\ displaystyle S \ Lambda ^ {k} L = S_ {k} T_ {k} U ^ {- 1},}  
SΛkLΛ-k=SkTkU-oneΛ-k.{\ displaystyle S \ Lambda ^ {k} L \ Lambda ^ {- k} = S_ {k} T_ {k} U ^ {- 1} \ Lambda ^ {- k}.}  

It can be shown that

ΛkLΛ-k→diag(leleven,...,lnn)=L′{\ displaystyle \ Lambda ^ {k} L \ Lambda ^ {- k} \ to \ mathrm {diag} \ left (l_ {11}, ..., l_ {nn} \ right) = L ^ {\ prime} }  

atk→∞, {\ displaystyle k \ to \ infty,}   without loss of generality, we can assume that there are units on the diagonal of the matrix L ; therefore,

SkTkU-oneΛ-k→S.{\ displaystyle S_ {k} T_ {k} U ^ {- 1} \ Lambda ^ {- k} \ to S.}  

We denote

Pk=TkU-oneΛ-k,{\ displaystyle P_ {k} = T_ {k} U ^ {- 1} \ Lambda ^ {- k},}  

moreover, the matrix P k is upper triangular, as the product of upper triangular and diagonal matrices.

Thus, we have proved that

SkPk→S{\ displaystyle S_ {k} P_ {k} \ to S}   .

It follows from the uniqueness of the QR decomposition that if the product of the orthogonal and triangular matrix converges to the orthogonal matrix, then the triangular matrix converges to the identity matrix . From the foregoing it follows that

Sk=Qone⋅...⋅Qk→S.{\ displaystyle S_ {k} = Q_ {1} \ cdot ... \ cdot Q_ {k} \ to S.}  

That is, the matrices S k converge to the eigenvector matrix of the matrix A.

Because

Ak+one=QkTAkQk=...=(QkT⋅...⋅QoneT)Aone(Qone⋅...⋅Qk)=(Qone⋅...⋅Qk)TA(Qone⋅...⋅Qk),{\ displaystyle A_ {k + 1} = Q_ {k} ^ {T} A_ {k} Q_ {k} = ... = \ left (Q_ {k} ^ {T} \ cdot ... \ cdot Q_ {1} ^ {T} \ right) A_ {1} \ left (Q_ {1} \ cdot ... \ cdot Q_ {k} \ right) = \ left (Q_ {1} \ cdot ... \ cdot Q_ {k} \ right) ^ {T} A \ left (Q_ {1} \ cdot ... \ cdot Q_ {k} \ right),}  

then

Ak+one=SkTASk.{\ displaystyle A_ {k + 1} = S_ {k} ^ {T} AS_ {k}.}  

Passing to the limit, we get:

limk→∞Ak=limk→∞Ak+one=STAS=STSΛSTS=Λ.{\ displaystyle \ lim _ {k \ to \ infty} A_ {k} = \ lim _ {k \ to \ infty} A_ {k + 1} = S ^ {T} AS = S ^ {T} S \ Lambda S ^ {T} S = \ Lambda.}  

So, we have proved that the QR algorithm allows us to solve the complete eigenvalue problem for a symmetric positive definite matrix.

QR algorithm implementation

Under certain conditions, a sequence of matricesAk {\ displaystyle A_ {k}}   converges to a triangular matrix, Schur decomposition of the matrixA {\ displaystyle A}   . In this case, the eigenvalues ​​of the triangular matrix are located on its diagonal, and the problem of finding the eigenvalues ​​is considered solved. In convergence tests, it is not practical to require exact zeros in the zero part of the matrix, but you can use sets the error limits.

In the initial state of the matrix (without additional transformations), the cost of iterations is relatively high. The cost of the algorithm can be reduced by first bringing the matrixA {\ displaystyle A}   to the form of the upper Hessenberg matrix (the cost of which is estimated asten3n3+O(n2) {\ displaystyle {10 \ over 3} n ^ {3} + O (n ^ {2})}   arithmetic operations using a method based on the Householder transform ), and using a finite sequence of orthogonal similarity transformations. This algorithm is somewhat similar to a two-way QR decomposition. (In a conventional QR decomposition, the Householder reflection matrix is ​​multiplied only on the left, when using the Hessenberg form the reflection matrix is ​​multiplied on both the left and right.) Finding the QR decomposition of the upper Hessenberg matrix is ​​estimated as6n2+O(n) {\ displaystyle 6n ^ {2} + O (n)}   arithmetic operations. Due to the fact that the shape of the Hessenberg matrix is ​​almost upper triangular (it has only one sub-diagonal element that is not equal to zero), it is possible to immediately reduce the number of iterations required for converging the QR algorithm.

If the original matrix is ​​symmetric, the upper Hessenberg matrix is ​​also symmetric and therefore is three-diagonal. The whole sequence of matrices has the same property.Ak {\ displaystyle A_ {k}}   . In this case, the cost of the procedure is estimated asfour3n3+O(n2) {\ displaystyle {4 \ over 3} n ^ {3} + O (n ^ {2})}   arithmetic operations using the Householder Transformation Method. Finding a QR decomposition of a symmetric tridiagonal matrix is ​​estimated asO(n) {\ displaystyle O (n)}   operations.

The rate of convergence depends on the degree of separation of the eigenvalues, and in practical implementation will be used "shifts", explicitly or implicitly, to enhance the separation of eigenvalues ​​and to accelerate convergence. In a typical form for symmetric matrices, the QR algorithm accurately finds one eigenvalue (decreasing the dimension of the matrix) in one or two iterations, making this approach both effective and reliable.

Implicit QR code implementation

In modern computational practice, the QR algorithm is performed using its implicit version, which makes it easier to add multiple “shifts”. Initially, the matrix is ​​reduced to the form of the upper Hessenberg matrixA0=QAQT {\ displaystyle A_ {0} = QAQ ^ {T}}   as well as in the explicit version. Then, at every step, the first columnAk {\ displaystyle A_ {k}}   converted through a small-sized transformation of Householder similarity to the first columnp(Ak) {\ displaystyle p (A_ {k})}   (orp(Ak)eone {\ displaystyle p (A_ {k}) e_ {1}}   ), wherep(Ak) {\ displaystyle p (A_ {k})}   is a polynomial of degreer {\ displaystyle r}   which defines a strategy for “shifts” (usuallyp(x)=(x-λ)(x-λ¯) {\ displaystyle p (x) = (x- \ lambda) (x - {\ bar {\ lambda}})}   whereλ {\ displaystyle \ lambda}   andλ¯ {\ displaystyle {\ bar {\ lambda}}}   these are two eigenvalues ​​of the residual submatrixAk {\ displaystyle A_ {k}}   size 2 x 2, this is the so-called implicit double shift). Then consecutive Householder transformations of dimensionr+one {\ displaystyle r + 1}   are made in order to return the working matrixAk {\ displaystyle A_ {k}}   to the form of the upper Hessenberg matrix.

Notes

  1. ↑ Numerical methods / N. S. Bakhvalov, N. P. Zhidkov, G. M. Kobelkov. - 3rd ed. - M: BINOM, Laboratory of knowledge, 2004. - S. 321. - 636 p. - ISBN 5-94774-175-X .

Links

  • Notes by Peter Olver on Orthogonal Bases and the QR Algorithm
Source - https://ru.wikipedia.org/w/index.php?title=QR- algorithm&oldid = 96043832


More articles:

  • Frizman, Leonid Genrikhovich
  • Southeast Asian Games 2015
  • Ganitsky, Anton Onufrievich
  • Temple V (Tikal)
  • Oketani, Hiromi
  • Uncle Gangsters
  • Orthodox-Catholic dialogue
  • Aleksenko, Andrey Gennadievich
  • Wande Hay, Mark Thomas
  • Republic Plaza (Singapore)

All articles

Clever Geek | 2019