Loading [MathJax]/jax/output/HTML-CSS/jax.js

Jan 14, 2012

QR algorithm as a sophistical power iteration


The QR algorithm is one of the most popular diagonalization algorithms. In this post, we compare it with several variations of the power iteration. Throughout this post, we only consider positive-defined hermitian matrices. If a matrix is not positively defined, one can always apply a shift: AA+sI,s=|min{λi,i=1,2,}|.

QR algorithm

Recall the QR decomposition (QR factorization) matrix A factorizes A into the matrix product of a orthogonal matrix Q and a upper  triangle matrix R, i.e. A=QR.  QR decomposition can be seen as the reorthogonalization of the column vectors of A. Namely, column vectors ai(i=1,,n) of A=[a1,a2,,an] are orthogonalized to Q=[q1,q2,,qn] such that aispan(q1,q2,,qi).  Based on QR decomposition, QR algorithm to diagonalize a matrix A reads:

  1. A0=A;
  2. Ak1QkRk (QR decomposition);
  3. Ak=RkQk.

Note that after procedures (2) and (3) Ak=QkAk1Qk. Hence AkAk1Ak2A0=A. There is a theorem to guarantee that under certain conditions, the sequence converges to diagonal matrix. We won't discuss the theorem here.

Power iteration

Power iteration is fairly simple. Choose a random vector v=iαixi where xi(i=1,2,,n) is eigenvector of A. Then
Akv=iαiλkixi. Therefore, if k is sufficiently large, λmmax{λi,i=1,2,,n} dominates, so Akvλkmxm. In practice, the resulted vector each step is normalized.

  1. v0= random unit vector ;
  2. vk=Avk1;
  3. vkvk/vk.


There are two issues in the power iteration. First of all, if the largest eigen-pair (eigenvalue and eigenvector) is degenerate, the iterated vector can only converge to a vector of the eigen-space. Secondly,  it can only generate the largest eigen-pair .

simultaneous power iteration

In order to overcome the first issue, more than one vector can be used simultaneously in iteration. The method is known as simultaneous power iteration. The algorithm can be described as following:

  1. V0=[v(0)1,v(0)2,,v(0)m]v(0)i is random vector ,i=1,2,,m;mn;
  2. Vk=AVk1;
  3. v(k)iv(k)i/v(k)ii=1,2,m.
The resulted vectors can be used to construct the degenerate eigen-space.

orthogonal power iteration

Simultaneous power iteration does not resolve the second issue. In principle, after obtaining the first eigenvector, it can be subtracted from the entire space. Then perform the power iteration for the rest subspace, the second largest eigen-pair can be obtained. However, this method is never practical. Because any numerical error may add the subtracted eigenvector back. In order to keep the calculated eigen-vector off, we can re-orthogonalize the vectors after each iteration. Notice that QR decomposition as described above can be used for the orthogonalization. This iteration scheme is known as orthogonal power iteration. The algorithm is sketched below:

  1. V0 is a n×n random matrix ;
  2. Vk1QkRk ( QR decomposition) ;
  3. Vk=AQk.


Power iteration vs. QR algorithm

Now let's compare orthogonal power iteration and QR algorithm. In orthogonal power iteration, define AkQkVk=QkAQkUkQk1Qk. It can be seen

  • Uk is orthogonal;
  • Ak1=Qk1QkRk=UkRk;
  • Ak=QkQk1Ak1Qk1Qk=UkAk1Uk

In fact, Ak1=UkRk is a QR decomposition of Ak1. That is to say, in orthogonal power iteration, Vk1 is QR-factorized, whereas in QR algorithm, Ak1 is QR-factorized. These two methods are equivalent. The operations on Ak yields a sequence identical to those in QR algorithm, if we further set Q0=IV0=A. The benefit of QR algorithm is that matrices Uk and Ak are exactly what we need.

This comparison shows that QR algorithm is actually equivalent to some variation of the power iteration. Therefore we could expect it has the similar performance (convergence rate, memory consumption etc.) with the power iteration.

No comments:

Post a Comment