Power iteration explained

A

, the algorithm will produce a number

λ

, which is the greatest (in absolute value) eigenvalue of

A

, and a nonzero vector

v

, which is a corresponding eigenvector of

λ

, that is,

Av=λv

.The algorithm is also known as the Von Mises iteration.[1]

Power iteration is a very simple algorithm, but it may converge slowly. The most time-consuming operation of the algorithm is the multiplication of matrix

A

by a vector, so it is effective for a very large sparse matrix with appropriate implementation. The speed of convergence is like

(λ1/

k
λ
2)

(see a later section). In words, convergence is exponential with base being the spectral gap.

The method

The power iteration algorithm starts with a vector

b0

, which may be an approximation to the dominant eigenvector or a random vector. The method is described by the recurrence relation

bk+1=

Abk
\|Abk\|

So, at every iteration, the vector

bk

is multiplied by the matrix

A

and normalized.

If we assume

A

has an eigenvalue that is strictly greater in magnitude than its other eigenvalues and the starting vector

b0

has a nonzero component in the direction of an eigenvector associated with the dominant eigenvalue, then a subsequence

\left(bk\right)

converges to an eigenvector associated with the dominant eigenvalue.

Without the two assumptions above, the sequence

\left(bk\right)

does not necessarily converge. In this sequence,

bk=

i\phik
e

v1+rk

,where

v1

is an eigenvector associated with the dominant eigenvalue, and

\|rk\|0

. The presence of the term
i\phik
e
implies that

\left(bk\right)

does not converge unless
i\phik
e

=1

. Under the two assumptions listed above, the sequence

\left(\muk\right)

defined by

\muk=

*
bAbk
k
*
bbk
k
converges to the dominant eigenvalue (with Rayleigh quotient).

One may compute this with the following algorithm (shown in Python with NumPy):

  1. !/usr/bin/env python3

import numpy as np

def power_iteration(A, num_iterations: int): # Ideally choose a random vector # To decrease the chance that our vector # Is orthogonal to the eigenvector b_k = np.random.rand(A.shape[1])

for _ in range(num_iterations): # calculate the matrix-by-vector product Ab b_k1 = np.dot(A, b_k)

# calculate the norm b_k1_norm = np.linalg.norm(b_k1)

# re normalize the vector b_k = b_k1 / b_k1_norm

return b_k

power_iteration(np.array(0.5, 0.5, [0.2, 0.8]]), 10)The vector

bk

converges to an associated eigenvector. Ideally, one should use the Rayleigh quotient in order to get the associated eigenvalue.

This algorithm is used to calculate the Google PageRank.

The method can also be used to calculate the spectral radius (the eigenvalue with the largest magnitude, for a square matrix) by computing the Rayleigh quotient

\rho(A)=max\left\{|λ1|,...c,|λn|\right\}=

\top
bAbk
k
\top
bbk
k

.

Analysis

Let

A

be decomposed into its Jordan canonical form:

A=VJV-1

, where the first column of

V

is an eigenvector of

A

corresponding to the dominant eigenvalue

λ1

. Since generically, the dominant eigenvalue of

A

is unique, the first Jordan block of

J

is the

1 x 1

matrix

[λ1],

where

λ1

is the largest eigenvalue of A in magnitude. The starting vector

b0

can be written as a linear combination of the columns of V:

b0=c1v1+c2v2++cnvn.

By assumption,

b0

has a nonzero component in the direction of the dominant eigenvalue, so

c1\ne0

.

The computationally useful recurrence relation for

bk+1

can be rewritten as:

bk+1=

Abk=
\|Abk\|
Ak+1b0
\|Ak+1b0\|

,

where the expression:

Ak+1b0
\|Ak+1b0\|
is more amenable to the following analysis.

\begin{align} bk&=

Akb0
\|Akb0\|

\\ &=

\left(VJV-1\right)kb0
\|\left(VJV-1\right)kb0\|

\\ &=

VJkV-1b0
\|VJkV-1b0\|

\\ &=

VJkV-1\left(c1v1+c2v2+ … +cnvn\right)
\|VJkV-1\left(c1v1+c2v2+ … +cnvn\right)\|

\\ &=

VJk\left(c1e1+c2e2+ … +cnen\right)
\|VJk\left(c1e1+c2e2+ … +cnen\right)\|

\\ &=\left(

λ1
|λ1|

\right)k

c1
|c1|
v1+
1
c1
V\left(
1
λ1
J\right)k\left(c2e2++cnen\right)
\left\|v1+
1
c1
V\left(
1
λ1
J\right)k\left(c2e2++cnen\right)\right\|

\end{align}

The expression above simplifies as

k\toinfty

\left(

1
λ1

J\right)k=\begin{bmatrix} [1]&&&&\\ &\left(

1
λ1

J2\right)k&&&\\ &&\ddots&\\ &&&\left(

1
λ1

Jm\right)k\\ \end{bmatrix} \begin{bmatrix} 1&&&&\\ &0&&&\\ &&\ddots&\\ &&&0\\ \end{bmatrix}ask\toinfty.

The limit follows from the fact that the eigenvalue of

1
λ1

Ji

is less than 1 in magnitude, so

\left(

1
λ1

Ji\right)k\to0ask\toinfty.

It follows that:

1
c1

V\left(

1
λ1

J\right)k\left(c2e2++cnen\right)\to0ask\toinfty

Using this fact,

bk

can be written in a form that emphasizes its relationship with

v1

when k is large:

\begin{align} bk&=\left(

λ1
|λ1|

\right)k

c1
|c1|
v+
1
c1
V\left(
1
λ1
J\right)k\left(c2e2++cnen\right)
1
\left\|v1+
1
c1
V\left(
1
λ1
J\right)k\left(c2e2++cnen\right)\right\|

\\[6pt] &=

i\phik
e
c1
|c1|
v1
\|v1\|

+rk\end{align}

where

i\phik
e

=\left(λ1/|λ1|\right)k

and

\|rk\|\to0

as

k\toinfty

The sequence

\left(bk\right)

is bounded, so it contains a convergent subsequence. Note that the eigenvector corresponding to the dominant eigenvalue is only unique up to a scalar, so although the sequence

\left(bk\right)

may not converge,

bk

is nearly an eigenvector of A for large k.

Alternatively, if A is diagonalizable, then the following proof yields the same result

Let λ1, λ2, ..., λm be the m eigenvalues (counted with multiplicity) of A and let v1, v2, ..., vm be the corresponding eigenvectors. Suppose that

λ1

is the dominant eigenvalue, so that

|λ1|>|λj|

for

j>1

.

The initial vector

b0

can be written:

b0=c1v1+c2v2++cmvm.

If

b0

is chosen randomly (with uniform probability), then c1 ≠ 0 with probability 1. Now,

\begin{align} Akb0&=c1Akv1+c2Akv2++cmAkvm\\ &=c1

k
λ
1

v1+c2

k
λ
2

v2++cm

k
λ
m

vm\\ &=c1

k
λ
1

\left(v1+

c2\left(
c1
λ2
λ1

\right)kv2++

cm\left(
c1
λm
λ1

\right)kvm\right)\\ &\toc1

k
λ
1

v1&&\left|

λj
λ1

\right|<1forj>1 \end{align}

On the other hand:

bk=

Akb0
kb
\|A
0\|

.

Therefore,

bk

converges to (a multiple of) the eigenvector

v1

. The convergence is geometric, with ratio

\left|

λ2
λ1

\right|,

where

λ2

denotes the second dominant eigenvalue. Thus, the method converges slowly if there is an eigenvalue close in magnitude to the dominant eigenvalue.

Applications

Although the power iteration method approximates only one eigenvalue of a matrix, it remains useful for certain computational problems. For instance, Google uses it to calculate the PageRank of documents in their search engine,[2] and Twitter uses it to show users recommendations of whom to follow.[3] The power iteration method is especially suitable for sparse matrices, such as the web matrix, or as the matrix-free method that does not require storing the coefficient matrix

A

explicitly, but can instead access a function evaluating matrix-vector products

Ax

. For non-symmetric matrices that are well-conditioned the power iteration method can outperform more complex Arnoldi iteration. For symmetric matrices, the power iteration method is rarely used, since its convergence speed can be easily increased without sacrificing the small cost per iteration; see, e.g., Lanczos iteration and LOBPCG.

Some of the more advanced eigenvalue algorithms can be understood as variations of the power iteration. For instance, the inverse iteration method applies power iteration to the matrix

A-1

. Other algorithms look at the whole subspace generated by the vectors

bk

. This subspace is known as the Krylov subspace. It can be computed by Arnoldi iteration or Lanczos iteration.Gram iteration is a super-linear and deterministic method to compute the largest eigenpair.

See also

Notes and References

  1. [Richard von Mises]
  2. News: Ipsen, Ilse, and Rebecca M. Wills . 5–8 May 2005 . 7th IMACS International Symposium on Iterative Methods in Scientific Computing . Fields Institute, Toronto, Canada .
  3. Pankaj Gupta, Ashish Goel, Jimmy Lin, Aneesh Sharma, Dong Wang, and Reza Bosagh Zadeh WTF: The who-to-follow system at Twitter, Proceedings of the 22nd international conference on World Wide Web