7 Eigenvalue Problems
\[ \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\N}{\mathbb{N}} \newcommand{\E}{\mathbb{E}} \newcommand{\eps}{\varepsilon} \newcommand{\abs}[1]{\left\lvert #1 \right\rvert} \newcommand{\norm}[1]{\left\lVert #1 \right\rVert} \newcommand{\ninf}[1]{\left\lVert #1 \right\rVert_{\infty}} \newcommand{\ntwo}[1]{\left\lVert #1 \right\rVert_{2}} \newcommand{\none}[1]{\left\lVert #1 \right\rVert_{1}} \newcommand{\inner}[2]{\left\langle #1,\, #2 \right\rangle} \newcommand{\bigO}{\mathcal{O}} \newcommand{\dd}{\mathrm{d}} \newcommand{\diff}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}} \newcommand{\pdiff}[2]{\frac{\partial #1}{\partial #2}} \newcommand{\spec}{\rho} \newcommand{\cond}{\kappa} \newcommand{\Span}{\operatorname{span}} \newcommand{\rank}{\operatorname{rank}} \newcommand{\tr}{\operatorname{tr}} \newcommand{\diag}{\operatorname{diag}} \newcommand{\argmax}{\operatorname*{arg\,max}} \newcommand{\argmin}{\operatorname*{arg\,min}} \newcommand{\defeq}{:=} \]
The characteristic polynomial \(\det(A-\lambda I)=0\) is how eigenvalues are defined; it is a poor way to compute them. Root-finding on a degree-\(n\) polynomial is badly conditioned in the coefficients, and simply assembling that polynomial already costs an \(\bigO(n^3)\) diagonalization, which we want to avoid. Often only part of the spectrum is needed. A few extreme eigenpairs are enough to answer the questions that actually come up: the equilibrium of a Markov chain, the ranking of a web graph, the leading directions of a data cloud, a low-rank compression of a matrix, a partition of a point set into clusters. The matrix–vector product underlies these computations. The power method extracts the dominant eigenpair, and its block version, subspace iteration, extracts a dominant subspace.
Throughout, \(A\in\R^{n\times n}\) has eigenvalues \(\lambda_1,\dots,\lambda_n\) and eigenvectors \(v_1,\dots,v_n\); \(\spec(A)=\max_i\abs{\lambda_i}\) is the spectral radius (Definition 6.4), and \(\sigma_1\ge\sigma_2\ge\dots\ge0\) are singular values. Norms, the condition number \(\cond(A)\) (Definition 4.6), and the matrix factorizations of Chapter 4 are used freely, with the symbol conventions of Notation: \(Q,R\) for orthonormal/triangular factors, and \(U\Sigma V^\top\) reserved for the SVD.
7.1 The power method
Given only the ability to apply \(A\) to a vector, we seek its dominant eigendirection. That direction is the eigenvector of largest eigenvalue, and the power method finds it by applying \(A\) repeatedly, using \(A\) once per step. Notably it never inspects the entries of \(A\); it needs only a routine that returns \(Au\) from \(u\) (a matvec). When a matvec is cheap (\(A\) sparse, or sparse-plus-low-rank, costing \(\bigO(n)\) per apply), a handful of eigenpairs come out in \(\bigO(n)\) work, where a full diagonalization would spend \(\bigO(n^3)\).
The idea and why it converges
Normalize \(A^kx\) at each step to track its direction. Suppose \(A\) is diagonalizable with a strictly dominant eigenpair \((\lambda_1,v_1)\): \[ \abs{\lambda_1}>\abs{\lambda_2}\ge\dots\ge\abs{\lambda_n}. \tag{7.1}\] When \(A\) is real this forces \(\lambda_1\) to be real: a complex \(\lambda_1\) would arrive with its conjugate \(\bar\lambda_1\) of equal modulus, contradicting strict dominance. Expand the seed in the eigenbasis, \(x=\sum_{i=1}^n c_iv_i\). Then \[ A^kx=\sum_{i=1}^n c_i\lambda_i^k v_i, \qquad \lambda_1^{-k}A^kx=c_1v_1+\sum_{i=2}^n c_i\Bigl(\tfrac{\lambda_i}{\lambda_1}\Bigr)^k v_i . \] Each ratio \(\abs{\lambda_i/\lambda_1}<1\) for \(i\ge2\), so every term but the first dies geometrically and \(\lambda_1^{-k}A^kx\to c_1v_1\). The one thing that can spoil this is \(c_1=0\), i.e. a seed exactly orthogonal (in the eigenbasis sense) to \(v_1\). That is a measure-zero accident: a seed drawn at random has \(c_1\ne0\) with probability one.
We do not know \(\lambda_1\), so we cannot literally divide by \(\lambda_1^k\). Instead we rescale to unit length, which removes whatever the dominant term’s magnitude happens to be: \[ u^{(k)}\defeq\frac{A^kx}{\ntwo{A^kx}} . \tag{7.2}\] Pulling the dominant term out of numerator and denominator, \[ u^{(k)}=\frac{\sum_i c_i\lambda_i^k v_i}{\bigl\lVert\sum_i c_i\lambda_i^k v_i\bigr\rVert} \;\longrightarrow\; \underbrace{\frac{c_1}{\abs{c_1}}\Bigl(\frac{\lambda_1}{\abs{\lambda_1}}\Bigr)^k}_{=:z^{(k)}} \,\frac{v_1}{\ntwo{v_1}}, \] with \(\abs{z^{(k)}}=1\) (so \(z^{(k)}=\pm1\) in the real case). The unit factor \(z^{(k)}\) records the sign or phase of an eigenvector, which is defined up to scaling; the direction is what converges.
Theorem 7.1 (Power method convergence) Let \(A\in\R^{n\times n}\) be diagonalizable with a strictly dominant eigenpair \((\lambda_1,v_1)\) as in Equation 7.1, and let \(x=\sum_i c_iv_i\) with \(c_1\ne0\). With \(u^{(k)}\) as in Equation 7.2 there exist unit scalars \(z^{(k)}\) (\(z^{(k)}=\pm1\) when \(A\) is real) such that \[ \lim_{k\to\infty}\frac{u^{(k)}}{z^{(k)}}=\frac{v_1}{\ntwo{v_1}} . \] The convergence is geometric: the error decays like \(\bigl(\abs{\lambda_2}/\abs{\lambda_1}\bigr)^k\). The rate is the ratio \(\abs{\lambda_2/\lambda_1}\); the absolute spectral gap \(\abs{\lambda_1}-\abs{\lambda_2}\) sets that rate only after normalizing by \(\abs{\lambda_1}\), since \(\abs{\lambda_2/\lambda_1}=1-(\abs{\lambda_1}-\abs{\lambda_2})/\abs{\lambda_1}\).
Proof. The displayed limit is the computation above: \(\lambda_1^{-k}A^kx\to c_1v_1\) term by term, and dividing by \(\ntwo{A^kx}\) cancels the divergent scale \(\abs{\lambda_1}^k\abs{c_1}\) while leaving the unit factor \(z^{(k)}\). The rate is set by the slowest-vanishing surviving term, \(\abs{\lambda_2/\lambda_1}^k\), which dominates the deviation \(u^{(k)}-z^{(k)}v_1/\ntwo{v_1}\). \(\square\)
The method also survives loss of diagonalizability when a strictly dominant eigenvector exists; the argument uses the Jordan form. See Figure 7.1 for the diagonalizable case.
Estimating the eigenvalue and stopping
To stop we want a residual, ideally the relative norm \(\ntwo{Au^{(k)}-\lambda_1u^{(k)}}/\abs{\lambda_1}\), but that needs \(\lambda_1\), which we do not have. Given an eigenvector estimate \(u\), the matching eigenvalue falls out of the Rayleigh quotient: if \(Au=\lambda u\) then \(u^\top Au=\lambda\ntwo{u}^2\), so \[ \lambda=\frac{u^\top Au}{\ntwo{u}^2}, \qquad\text{and for unit }u,\quad \lambda=u^\top Au . \tag{7.3}\] This gives the running estimate \(\lambda_1^{(k)}=u^{(k)}\cdot(Au^{(k)})\) and a computable stopping test \(\ntwo{Au^{(k)}-\lambda_1^{(k)}u^{(k)}}/\abs{\lambda_1^{(k)}}\le\eps\).
Given a seed \(x^{(0)}\in\R^n\), a matvec routine for \(A\), a cap \(m\), and a tolerance \(\eps\). For \(k=0,1,\dots,m\):
- Normalize: \(u^{(k)}\leftarrow x^{(k)}/\ntwo{x^{(k)}}\).
- Matvec: \(x^{(k+1)}\leftarrow Au^{(k)}\).
- Rayleigh-quotient estimate: \(\lambda_1^{(k)}\leftarrow u^{(k)}\cdot x^{(k+1)}\).
- If \(\ntwo{x^{(k+1)}-\lambda_1^{(k)}u^{(k)}}/\abs{\lambda_1^{(k)}}\le\eps\), break.
Return \((\lambda_1^{(k)},u^{(k)})\). Each step is one matvec plus \(\bigO(n)\) work.
A worked run
Take the symmetric \[ A=\begin{pmatrix}2&1\\1&2\end{pmatrix}, \qquad \lambda_1=3,\ v_1=\tfrac1{\sqrt2}(1,1)^\top,\qquad \lambda_2=1,\ v_2=\tfrac1{\sqrt2}(1,-1)^\top, \] and seed \(x^{(0)}=(1,0)^\top\). The Rayleigh-quotient estimates \(\lambda_1^{(k)}=u^{(k)}\cdot Au^{(k)}\) run \[ 2.000,\quad 2.800,\quad 2.976,\quad 2.997,\quad \to 3 . \] Two rates coexist here. The eigenvector direction converges at the raw ratio \(\abs{\lambda_2/\lambda_1}=1/3\) (this is the quantity Figure 7.1 tracks for other spectra). The eigenvalue estimate converges faster, at the squared rate \((\lambda_2/\lambda_1)^2=1/9\) per step: the error sequence \(1,\,0.2,\,0.024,\,0.0027\) shrinks by roughly \(1/9\) each time. The squaring is no accident, for a symmetric matrix the Rayleigh quotient Equation 7.3 is stationary at an eigenvector, so a first-order error in the direction shows up only to second order in the estimate.
The power method is a linearly convergent iteration in the sense of Definition 8.5: the error contracts by a constant factor \(\abs{\lambda_2/\lambda_1}<1\) every step (order \(q=1\)). That is the same regime as the stationary linear solvers of Chapter 5 and slower than the quadratic order \(q=2\) of Newton’s method in Section 8.3. The trade is deliberate: each step here is a single matvec, with no derivatives and no linear solves, which reduces the per-step cost for a large sparse \(A\).
The power method finds the extreme eigenvalue of whatever operator it is fed, so we can aim it elsewhere by feeding it a transformed matrix, all of which share the eigenvectors of \(A\). A shift \(A-\mu I\) moves the spectrum by \(\mu\) (eigenvalues \(\lambda_i-\mu\)); an inverse \((A-\mu I)^{-1}\) has eigenvalues \(1/(\lambda_i-\mu)\), so its dominant eigenpair is the one with \(\lambda_i\) nearest the shift \(\mu\). This is inverse iteration: pick \(\mu\) near the eigenvalue you want and run the power method on \((A-\mu I)^{-1}\), applying it by solving \((A-\mu I)y=u\) each step instead of a matvec. Taking \(\mu=0\) retargets to the eigenvalue of smallest modulus. The same idea recurs at the block level in Section 7.6.3, where running subspace iteration on \(2I-\hat L\) (a shift, then extreme end) picks out the smallest eigenpairs of the Laplacian \(\hat L\).
7.2 Subspace iteration: the block power method
To capture a \(k\)-dimensional dominant subspace instead of a single direction, iterate the power method on \(k\) vectors simultaneously and keep them from collapsing onto the same dominant direction by reorthonormalizing after every apply. This is subspace iteration; together with the Rayleigh–Ritz step at the end, it is used for PCA, the randomized SVD, and spectral clustering.
Basic algorithm
Let \(A\in\R^{n\times n}\) be diagonalizable, order its eigenvalues by modulus, and assume a spectral gap after the \(k\)-th: \[ \abs{\lambda_1}\ge\dots\ge\abs{\lambda_k}>\abs{\lambda_{k+1}}\ge\dots\ge\abs{\lambda_n}. \tag{7.4}\] Collect the leading eigenvectors into \(V_\star=[v_1,\dots,v_k]\in\R^{n\times k}\) (not orthonormal in general, since \(A\) need not be symmetric); we want the subspace \(\Span(V_\star)\). Start from a block \(Z=[z_1,\dots,z_k]\in\R^{n\times k}\).
Theorem 7.2 (Subspace iteration convergence) For a generic block \(Z\in\R^{n\times k}\) there is a sequence of invertible \(C_l\in\R^{k\times k}\) with \[ \lim_{l\to\infty}A^lZC_l=V_\star . \] Hence \(\Span(A^lZ)\to\Span(V_\star)\) as a subspace, even though \(A^lZ\) itself has no limit.
The precise genericity condition and the matrices \(C_l\) appear in the proof (Section 7.2.2). Forming \(A^lZ\) literally would overflow, so the practical iteration reorthonormalizes the block each step, the block version of the power method’s normalization. Write \(Q\) for an orthonormal basis of \(\Span(Z)\) (from Gram–Schmidt, a thin QR factorization \(Z=QR\), or Matlab’s orth):
Given a generic \(Z\in\R^{n\times k}\), matvec access to \(A\), and a cap \(m\). Let \(Q\) have orthonormal columns spanning \(\Span(Z)\). For \(j=0,1,\dots,m\):
- \(Z\leftarrow AQ\) (this is \(k\) matvecs, one per column).
- Reorthonormalize: let \(Q\) have orthonormal columns spanning \(\Span(Z)\).
Return \(Q\). For \(m\) large, \(\Span(Q)\approx\Span(V_\star)\).
Each pass costs \(k\) matvecs plus an \(\bigO(nk^2)\) orthonormalization. Sparse \(A\) (with \(\bigO(n)\) nonzeros) makes the matvecs \(\bigO(nk)\); even dense they are \(\bigO(n^2k)\), against \(\bigO(n^3)\) for a full diagonalization when \(k\ll n\).
Convergence proof
Proof. Diagonalize \(A=S\Lambda S^{-1}\) with \(S=[v_1,\dots,v_n]=[\,V_\star\mid V_\star'\,]\) (so \(V_\star'=[v_{k+1},\dots,v_n]\)) and \[ \Lambda=\begin{pmatrix}\Lambda_1&0\\0&\Lambda_2\end{pmatrix}, \qquad \Lambda_1=\diag(\lambda_1,\dots,\lambda_k),\quad\Lambda_2=\diag(\lambda_{k+1},\dots,\lambda_n); \] the gap Equation 7.4 makes \(\Lambda_1\) invertible. Change coordinates to the eigenbasis by setting \(Y=S^{-1}Z=\binom{Y_1}{Y_2}\) with \(Y_1\) of size \(k\times k\).
Hypothesis (G). \(Y_1\) is invertible. Equivalently, the seed block \(Z\) has a full-rank projection onto the dominant eigenspace \(\Span(V_\star)\). A random \(Z\) satisfies (G) with probability one, exactly as \(c_1\ne0\) did for the single-vector method.
Choose \(C_l=Y_1^{-1}\Lambda_1^{-l}\) (invertible under (G)). Then \[ A^lZC_l=S\Lambda^lYC_l =S\begin{pmatrix}\Lambda_1^lY_1\\\Lambda_2^lY_2\end{pmatrix}Y_1^{-1}\Lambda_1^{-l} =S\begin{pmatrix}I_k\\ M_l\end{pmatrix}, \qquad M_l=\Lambda_2^l\,(Y_2Y_1^{-1})\,\Lambda_1^{-l}. \] The tail block \(M_l\) vanishes geometrically. Its entries are \[ (M_l)_{ij}=\Bigl(\tfrac{\lambda_{k+i}}{\lambda_j}\Bigr)^l (Y_2Y_1^{-1})_{ij}, \qquad \Bigl\lvert\tfrac{\lambda_{k+i}}{\lambda_j}\Bigr\rvert\le\frac{\abs{\lambda_{k+1}}}{\abs{\lambda_k}}<1 \] for \(i\ge1,\ j\le k\), so \(M_l\to0\) at rate \((\abs{\lambda_{k+1}}/\abs{\lambda_k})^l\). Therefore \(A^lZC_l\to S\binom{I_k}{0}=[\,V_\star\mid V_\star'\,]\binom{I_k}{0}=V_\star\). \(\square\)
A computable convergence test
To stop, we need to measure how far successive subspaces sit apart, and a subspace has no coordinates, only its orthogonal projector does. So compare projectors. For orthonormal bases \(Q,Q'\in\R^{n\times k}\) (\(Q^\top Q=Q'^\top Q'=I_k\)) of two candidate subspaces, write the projectors \(\Pi=QQ^\top\) and \(\Pi'=Q'Q'^\top\) and measure them in the Frobenius inner product \(\inner{X}{Y}_{\mathrm F}=\tr(X^\top Y)\).
Theorem 7.3 (Projector distance between subspaces) If \(Q,Q'\in\R^{n\times k}\) have orthonormal columns with projectors \(\Pi=QQ^\top\), \(\Pi'=Q'Q'^\top\), then \[ \norm{\Pi-\Pi'}_{\mathrm F}^2=2\Bigl(k-\norm{Q^\top Q'}_{\mathrm F}^2\Bigr), \qquad \frac{\norm{\Pi-\Pi'}_{\mathrm F}}{\norm{\Pi}_{\mathrm F}} =\sqrt2\,\sqrt{1-k^{-1}\norm{Q^\top Q'}_{\mathrm F}^2}. \]
Proof. Expand the squared Frobenius norm as the inner product of \(\Pi-\Pi'\) with itself: \[ \norm{\Pi-\Pi'}_{\mathrm F}^2 =\inner{\Pi}{\Pi}_{\mathrm F}-2\inner{\Pi}{\Pi'}_{\mathrm F}+\inner{\Pi'}{\Pi'}_{\mathrm F}. \] Each projector is symmetric and idempotent, so \(\inner{\Pi}{\Pi}_{\mathrm F}=\tr(\Pi^\top\Pi)=\tr(\Pi)\), and cycling the trace \(\tr(QQ^\top)=\tr(Q^\top Q)=\tr(I_k)=k\); likewise \(\inner{\Pi'}{\Pi'}_{\mathrm F}=k\). For the cross term, \[ \inner{\Pi}{\Pi'}_{\mathrm F}=\tr(QQ^\top Q'Q'^\top)=\tr\!\bigl((Q^\top Q')(Q^\top Q')^\top\bigr) =\norm{Q^\top Q'}_{\mathrm F}^2, \] again by cycling the trace to expose the small \(k\times k\) matrix \(Q^\top Q'\). Substituting gives the first identity; the second divides through by \(\norm{\Pi}_{\mathrm F}=\sqrt{k}\). \(\square\)
The formula reduces the cost. The distance is read off the tiny \(k\times k\) matrix \(Q^\top Q'\) in \(\bigO(nk^2)\), never assembling the \(n\times n\) projectors (which would cost \(\bigO(n^2k)\)).
Stopping test and full algorithm
Given a generic \(Z\in\R^{n\times k}\), matvec access to \(A\), a cap \(m\), and tolerance \(\eps\). Let \(Q\) have orthonormal columns spanning \(\Span(Z)\). For \(j=0,1,\dots,m\):
- \(Z\leftarrow AQ\).
- Let \(Q'\) have orthonormal columns spanning \(\Span(Z)\).
- \(\delta\leftarrow\sqrt2\,\sqrt{1-k^{-1}\norm{Q^\top Q'}_{\mathrm F}^2}\).
- \(Q\leftarrow Q'\).
- If \(\delta<\eps\), break.
Return \(Q\), whose span approximates \(\Span(V_\star)\).
Recovering eigenpairs via Rayleigh–Ritz
For symmetric \(A\), Rayleigh–Ritz extracts eigenpairs from the computed subspace by diagonalizing the \(k\times k\) restriction \(Q^\top AQ\). If \(\Span(Q)=\Span(V_\star)\), it returns the exact \(\lambda_1,\dots,\lambda_k\) and an orthonormal eigenbasis; repeated eigenvalues leave the basis within each eigenspace undetermined.
Definition 7.1 (Rayleigh–Ritz procedure) Given an orthonormal basis \(Q\in\R^{n\times k}\) of an (approximately) invariant subspace of a symmetric \(A\):
- Form the \(k\times k\) symmetric matrix \(\bar A=Q^\top AQ\) (the Rayleigh quotient of the block).
- Diagonalize it fully, \(\bar A=W\bar\Lambda W^\top\), with \(W\) orthogonal (\(k\times k\)) and \(\bar\Lambda\) diagonal, entries ordered by decreasing modulus. This costs \(\bigO(k^3)\), independent of \(n\).
- Return the Ritz values \(\bar\Lambda\) and Ritz vectors \(\widehat Q=QW\).
Theorem 7.4 (Exactness of Rayleigh–Ritz) If \(\Span(Q)=\Span(V_\star)\) for the dominant orthonormal eigenblock \(V_\star\) of a symmetric \(A\), then the Rayleigh–Ritz procedure yields \(\bar\Lambda=\Lambda_1\) and \(\widehat Q=QW\) satisfies \(A\widehat Q=\widehat Q\Lambda_1\).
Proof. Both \(Q\) and \(V_\star\) are orthonormal bases of the same subspace, so they are related by an orthogonal change of basis \(O=V_\star^\top Q\): indeed \(V_\star O=V_\star V_\star^\top Q=\Pi_{V_\star}Q=Q\) because \(\Pi_{V_\star}=V_\star V_\star^\top\) fixes \(\Span(V_\star)\supseteq\Span(Q)\), and \(O^\top O=Q^\top V_\star V_\star^\top Q=Q^\top Q=I_k\). Then \[ \bar A=Q^\top AQ=(V_\star O)^\top A(V_\star O)=O^\top(V_\star^\top AV_\star)O=O^\top\Lambda_1 O , \] using \(AV_\star=V_\star\Lambda_1\) and \(V_\star^\top V_\star=I_k\). Since \(O\) is orthogonal, \(\bar A=O^\top\Lambda_1O\) already exhibits a diagonalization of \(\bar A\) with eigenvalues \(\lambda_1,\dots,\lambda_k\); ordering both the same way forces \(\bar\Lambda=\Lambda_1\), the first claim. For the second, insert \(I_k=OO^\top\) and \(\bar A=W\bar\Lambda W^\top=O^\top\Lambda_1O\) into \(A\widehat Q\): \[ A\widehat Q=AQW=A(V_\star O)W=V_\star\Lambda_1OW =V_\star O\,(O^\top\Lambda_1O)\,W=V_\star O\bar AW =V_\star O\,(W\bar\Lambda W^\top)\,W=V_\star OW\bar\Lambda=(QW)\Lambda_1=\widehat Q\Lambda_1 , \] using \(W^\top W=I_k\) and \(\bar\Lambda=\Lambda_1\) at the last steps. \(\square\)
7.3 When the dominant eigenvector is the answer: Markov chains
Consider a system with \(n\) states \(1,\dots,n\) hopping at random between discrete times. For each state \(j\) we know a column of probabilities \(p_j=(p_{1j},\dots,p_{nj})^\top\), where \(p_{ij}\) is the chance of landing in state \(i\) next given that we are in state \(j\) now. The future depends only on the present (the Markov property). Probabilities demand \(p_{ij}\ge0\) and \(\sum_i p_{ij}=1\) for every \(j\), the latter being \(\mathbf 1^\top p_j=1\) with \(\mathbf 1\) the all-ones vector.
Definition 7.2 (Column-stochastic matrix) \(P=(p_{ij})\) is (column) stochastic if \(P\ge0\) entrywise and \(P^\top\mathbf 1=\mathbf 1\) (every column sums to \(1\)). It is positive, written \(P>0\), if \(p_{ij}>0\) for all \(i,j\).
A vector \(\pi\in\R^n\) is a probability distribution if \(\pi\ge0\) and \(\mathbf 1^\top\pi=1\).
Proposition 7.1 (Distributions evolve by \(P\)) If \(\pi\) is the distribution of the state \(X_t\) at time \(t\), then \(P\pi\) is its distribution at time \(t+1\).
Proof. Condition on the current state and use the Markov property: \[ \Pr(X_{t+1}=i)=\sum_{j=1}^n\Pr(X_{t+1}=i\mid X_t=j)\,\Pr(X_t=j)=\sum_{j=1}^n p_{ij}\pi_j=[P\pi]_i . \] And \(P\) keeps distributions distributions: \(\mathbf 1^\top(P\pi)=(P^\top\mathbf 1)^\top\pi=\mathbf 1^\top\pi=1\), with \(P\pi\ge0\) since \(P,\pi\ge0\). \(\square\)
So time evolution is repeated application of \(P\), and the object of interest is the long-run limit \(\pi_\infty=\lim_{k\to\infty}P^k\pi\). If it exists it is again a probability vector, and passing to the limit in \(\pi_{k+1}=P\pi_k\) makes it a fixed point, \[ \pi_\infty=P\pi_\infty , \tag{7.5}\] the equilibrium (or invariant) distribution. Two facts tie this back to Section 7.1. First, Equation 7.5 says \(\pi_\infty\) is an eigenvector of \(P\) with eigenvalue \(1\). Second, \(P^k\pi\) is exactly the (already-normalized) power-method sequence for \(P\). So the equilibrium is the dominant eigenvector, provided the power method’s hypotheses hold, which positivity guarantees.
Theorem 7.5 (Perron–Frobenius) Let \(P\) be a positive stochastic matrix. Then \(P\) has a strictly dominant eigenvalue equal to \(1\), whose eigenvector can be scaled to a probability distribution. Hence the power method converges to the invariant distribution \(\pi_\infty\).
We take Theorem 7.5 as given: positivity forces a unique largest-modulus eigenvalue with a positive eigenvector, a matrix-analysis result whose refinements weaken positivity to irreducibility and aperiodicity.
PageRank
The web is a directed graph: pages \(1,\dots,n\) and edges \(E\), where \((i,j)\in E\) means page \(i\) links to page \(j\), encoded by an adjacency matrix \(A\) with \(A_{ij}=1\) on edges and \(0\) otherwise. We want to rank pages by importance. Counting inbound links is too crude: a link from a prominent page ought to count more than a link from a backwater, so PageRank uses eigenvector centrality: a page is important if important pages link to it. That self-reference is precisely what an eigenvector resolves.
From links to a chain. Turn the nonnegative \(A\) into a stochastic matrix the standard way: normalize each column to sum to one. Assuming every page has an outgoing link (delete any that do not), define \(\tilde P\) by \[ \tilde P^\top=\diag(A\mathbf 1)^{-1}A, \qquad \tilde P_{ji}=\begin{cases}\dfrac{1}{\deg^-(i)}, & (i,j)\in E,\\[2pt] 0,&(i,j)\notin E,\end{cases} \tag{7.6}\] with \(\deg^-(i)\) the outdegree of page \(i\). The reading is a random walk: from the current page, follow a uniformly random outgoing link.
Damping. Plain \(\tilde P\) can converge slowly and dangling structure can break the hypotheses. The remedy is a damping factor \(\tau\in(0,1)\): with probability \(\tau\) follow a link, and with probability \(1-\tau\) teleport to a page chosen uniformly at random. This is the chain \[ P=\tau\tilde P+(1-\tau)\tfrac1n\mathbf 1\mathbf 1^\top , \tag{7.7}\] with \(\mathbf 1\mathbf 1^\top\) the all-ones matrix. Now \(P\) is stochastic and strictly positive, so Theorem 7.5 delivers a dominant eigenvector \(\pi^{\star}\) with eigenvalue \(1\); scaled to \(\pi^{\star}\ge0\), \(\mathbf 1^\top\pi^{\star}=1\), the entry \(\pi^{\star}_i\) is the PageRank of page \(i\), the long-run fraction of time the surfer spends there.
PageRank is the power method on \(P\) of Equation 7.7, only simpler: the dominant eigenvalue is exactly \(1\), so no renormalization is ever needed. Start from any distribution \(\pi^{(0)}\) and iterate \(\pi^{(k+1)}=P\pi^{(k)}\); each iterate stays a distribution and \(\pi^{(k)}\to\pi^{\star}\). The matrix \(P\) is never formed densely: the damping term acts as \(\tfrac{1-\tau}{n}(\mathbf 1^\top\pi^{(k)})\mathbf 1=\tfrac{1-\tau}{n}\mathbf 1\), so each step costs \(\bigO(\lvert E\rvert)\).
A three-page example. Let page \(1\) link to \(\{2,3\}\), page \(2\) to \(\{3\}\), and page \(3\) to \(\{1\}\), outdegrees \((2,1,1)\). Column-normalizing gives \[ \tilde P=\begin{pmatrix}0&0&1\\[2pt]\tfrac12&0&0\\[2pt]\tfrac12&1&0\end{pmatrix}, \] whose invariant distribution solves \(\tilde P\pi=\pi\): from the rows, \(\pi_1=\pi_3\) and \(\pi_2=\tfrac12\pi_1\), and normalizing \(\pi_1+\pi_2+\pi_3=1\) gives \[ \pi=(0.4,\ 0.2,\ 0.4). \] Damping with \(\tau=0.85\) (the classic choice) shifts this only slightly, to \[ \pi^\star=(0.388,\ 0.215,\ 0.397), \] mixing in the uniform teleport distribution \((\tfrac13,\tfrac13,\tfrac13)\), a small, stabilizing perturbation. Pages \(1\) and \(3\) tie in the undamped chain; damping breaks the tie faintly in favour of \(3\). Notice that page \(1\) keeps pace with page \(3\) despite having only one inbound link to page \(3\)’s two: its single backlink comes from page \(3\) itself, a high-rank page, so its importance is inherited, not counted by raw inbound links.
7.4 Principal component analysis
The decompositions PCA rests on
Every \(A\in\R^{m\times n}\) factors as \(A=U\Sigma V^\top\) with orthogonal \(U,V\) and \(\Sigma=\diag(\sigma_1,\sigma_2,\dots)\), \(\sigma_1\ge\sigma_2\ge\dots\ge0\), the SVD. The compact form keeps the \(r=\rank(A)\) positive singular values, \(A=\sum_{i=1}^r\sigma_iu_iv_i^\top\), and the truncated rank-\(k\) form keeps the top \(k\). The SVD relates to the spectral theorem through \(A^\top A=V\Sigma^2V^\top\) and \(AA^\top=U\Sigma^2U^\top\), so the right and left singular vectors are eigenvectors of \(A^\top A\) and \(AA^\top\) with eigenvalues \(\sigma_i^2\), which allows eigenvalue methods to compute an SVD. The one theorem we invoke is Eckart–Young–Mirsky: among all rank-\(k\) matrices, the truncated SVD is the closest to \(A\) in Frobenius norm.
The optimization and its solution
Given data points \(x_j\in\R^m\), \(j=1,\dots,n\), PCA seeks the \(k\)-dimensional subspace that best captures the cloud, in statistical terms, the one explaining the most variance. Assume the data is de-meaned, \(\frac1n\sum_j x_j=0\) (subtract the mean if not), and stack it into \(X=[x_1,\dots,x_n]\in\R^{m\times n}\), with empirical covariance \(\frac1n XX^\top\).
Describe a subspace by an orthonormal basis \(Q=[q_1,\dots,q_k]\), \(Q^\top Q=I_k\), with projector \(\Pi=QQ^\top\). Minimize the total squared distance of the data from the subspace, \[ f(Q)\defeq\sum_{j=1}^n\ntwo{x_j-\Pi x_j}^2 . \tag{7.8}\] Since \((I-QQ^\top)x_j\) is the \(j\)-th column of \((I-QQ^\top)X\) and the squared Frobenius norm sums squared column norms, \[ f(Q)=\bigl\lVert X-QQ^\top X\bigr\rVert_{\mathrm F}^2 . \] Now let \(X=\sum_{i=1}^r\sigma_iu_iv_i^\top\) be the compact SVD and \(\tilde X=\sum_{i=1}^k\sigma_iu_iv_i^\top\) its rank-\(k\) truncation, with \(\tilde U=[u_1,\dots,u_k]\). Because \(\rank(QQ^\top X)\le k\), Eckart–Young says no \(Q\) can bring \(QQ^\top X\) nearer to \(X\) than \(\tilde X\); and \(Q=\tilde U\) attains the bound, since \[ QQ^\top X=\tilde U\tilde U^\top\sum_{i=1}^r\sigma_iu_iv_i^\top=\sum_{i=1}^k\sigma_iu_iv_i^\top=\tilde X , \] using \(\tilde U^\top u_i=e_i\) for \(i\le k\) and \(0\) for \(i>k\). So the optimal subspace is the span of the top \(k\) left singular vectors of the de-meaned \(X\), equivalently, the span of the dominant \(k\) eigenvectors of the covariance \(\frac1n XX^\top\), which is exactly what subspace iteration on \(XX^\top\) returns.
For a point \(x_j\), the coordinate \(u_i\cdot x_j\) is its \(i\)-th principal component; the \(j\)-th column of \(Y=Q^\top X\in\R^{k\times n}\) collects the first \(k\). Reading \(Y\) as a compression \(\R^m\to\R^k\), we recover the data by \(\tilde X=QY=QQ^\top X\), and because \(Q\) minimized Equation 7.8 this recovery is as faithful as any \(k\)-dimensional linear compression can be.
A two-dimensional example
Take the four points \((2,0),(0,1),(-2,0),(0,-1)\). Their mean is \(0\), so no de-meaning is needed, and the data matrix and covariance are \[ X=\begin{pmatrix}2&0&-2&0\\0&1&0&-1\end{pmatrix}, \qquad \frac14 XX^\top=\frac14\begin{pmatrix}8&0\\0&2\end{pmatrix}=\begin{pmatrix}2&0\\0&\tfrac12\end{pmatrix}. \] The covariance is already diagonal, so the principal components are the coordinate axes: the first is the \(x\)-axis with variance \(2\), the second the \(y\)-axis with variance \(\tfrac12\). The top component captures \(2/(2+\tfrac12)=80\%\) of the total variance, so projecting these four points onto the \(x\)-axis, the span of the top left singular vector, is the best one-dimensional summary, keeping four fifths of the spread.
7.5 Randomized SVD
Subspace iteration plus Rayleigh–Ritz already computes a truncated SVD: the top \(k\) left singular vectors of \(A\in\R^{m\times n}\) (\(m\ge n\)) are the dominant \(k\) eigenvectors of \(AA^\top\) (eigenvalues \(\sigma_i^2\)), the right ones the dominant \(k\) eigenvectors of \(A^\top A\). But when the gap \(\sigma_k-\sigma_{k+1}\) is small the iteration crawls. The randomized SVD skips iteration altogether, trading it for a controlled error that shrinks with how fast the singular values decay.
The exact-rank warm-up
Suppose \(\rank(A)=k\) exactly. Draw a random \(Z=[z_1,\dots,z_k]\in\R^{n\times k}\). The images \(Az_1,\dots,Az_k\) lie in \(\operatorname{range}(A)\) and, with probability one, are independent, so they span it: \[ \Span(AZ)=\operatorname{range}(A)=\Span(u_1,\dots,u_k), \] the last equality because \(A=\sum_{i=1}^k\sigma_iu_iv_i^\top\) stops at \(k\). So a single random matvec block exposes the range, no iteration at all. Let \(X=\operatorname{orth}(AZ)\) span \(\Span(u_1,\dots, u_k)\). Feeding \(X\) to Rayleigh–Ritz on \(AA^\top\) recovers \(U\) and \(\Sigma\): form \(B=X^\top AA^\top X=(X^\top A)(X^\top A)^\top\), diagonalize \(B=W\bar\Lambda W^\top\), and set \(U=XW\), \(\Sigma=\sqrt{\bar\Lambda}\).
A two-sided construction delivers \(U\), \(\Sigma\), and \(V\) together. Draw a second random \(W_0\in\R^{m\times k}\) and let \(Y=\operatorname{orth}(A^\top W_0)\) span the row space. Since \(XX^\top A=A\) (as \(XX^\top\) projects onto \(\operatorname{range}(A)\)) and \(AYY^\top=A\), \[ A=XX^\top A=XX^\top AYY^\top=X(X^\top AY)Y^\top . \] Form the small \(\bar A=X^\top AY\in\R^{k\times k}\) (generally not symmetric), take its full SVD \(\bar A=\tilde U\tilde\Sigma\tilde V^\top\), and read off \(U=X\tilde U\), \(V=Y\tilde V\), \(\Sigma=\tilde\Sigma\). This agrees with the two-sided recipe, since \(\bar A\bar A^\top=X^\top AA^\top X=B\): the singular vectors of the tiny \(\bar A\) are the very eigenvectors Rayleigh–Ritz would produce.
Beyond rank \(k\)
Real matrices are rarely exactly rank \(k\). So oversample: draw \(\tilde k\ge k\) random vectors \(Z\in\R^{n\times\tilde k}\), \(W_0\in\R^{m\times\tilde k}\), so that \(\Span(AZ)\) and \(\Span(A^\top W_0)\) only approximately contain the ranges. With \(X=\operatorname{orth}(AZ)\), \(Y=\operatorname{orth}(A^\top W_0)\), \[ A\approx XX^\top A\approx XX^\top AYY^\top=X\bar AY^\top, \qquad \bar A=X^\top AY\in\R^{\tilde k\times\tilde k}. \]
Theorem 7.6 (Randomized range approximation) Let \(\delta>0\), \(A\in\R^{m\times n}\), and \(X=\operatorname{orth}(AZ)\) with \(Z\in\R^{n\times\tilde k}\) having i.i.d. standard-normal entries. There is a universal constant \(C\) such that if \(\tilde k\ge C\,(k+\log(1/\delta))\), then with probability at least \(1-\delta\), \[ \bigl\lVert (I-XX^\top)A\bigr\rVert_{\mathrm F}^2\le 2\sum_{i>k}\sigma_i^2 , \] \(\sigma_i\) the singular values of \(A\). (Some sources print this as \(\lVert XX^\top A\rVert_{\mathrm F}\), the projection onto the range rather than the residual, which is \(\approx\lVert A\rVert_{\mathrm F}\), not small; the residual bound above is the one that matters.)
A matrix has numerical rank \(k\) when \(\sum_{i>k}\sigma_i^2\) is negligible. In that case, oversampling to a small multiple of \(k\) gives an accurate range approximation with high probability (Figure 7.4).
Given matvec access to \(A\) and \(A^\top\), target rank \(k\), oversampling \(\tilde k\ge k\):
- Draw \(Z\in\R^{n\times\tilde k}\), \(W_0\in\R^{m\times\tilde k}\) with i.i.d. standard-normal entries.
- Form \(AZ\) and \(A^\top W_0\); orthonormalize the columns to get \(X\) and \(Y\).
- Form \(\bar A=X^\top AY\in\R^{\tilde k\times\tilde k}\) and take its full SVD \(\bar A=\tilde U\tilde\Sigma\tilde V^\top\).
- Recover \(\hat U=[X\tilde U]_{:,1:k}\), \(\hat V=[Y\tilde V]_{:,1:k}\), \(\hat\Sigma=[\tilde\Sigma]_{1:k,1:k}\).
Then \(A\approx\hat U\hat\Sigma\hat V^\top\) is an approximate rank-\(k\) truncated SVD.
7.6 Spectral clustering
Spectral clustering embeds data using the eigenvectors of a graph Laplacian before applying \(k\)-means. For interleaved clusters such as concentric rings, this can separate groups that \(k\)-means on the original coordinates misses (Figure 7.5).
A weighted graph from data
Given \(x_1,\dots,x_n\in\R^m\), build a weighted graph whose edge weights measure similarity. A similarity kernel is a symmetric \(K(x,y)=K(y,x)\ge0\); the usual pick is the Gaussian kernel of width \(\sigma>0\), \[ K(x,y)=e^{-\frac{1}{2\sigma^2}\ntwo{x-y}^2}. \tag{7.9}\] This yields a symmetric weighted adjacency matrix \(A_{ij}=K(x_i,x_j)\), large for nearby points.
Graph Laplacians
Definition 7.3 (Graph Laplacian) Let \(A\) be symmetric with nonnegative entries and positive degrees \(D_{ii}=\sum_j A_{ij}\), collected in \(D=\diag(A\mathbf 1)\). The graph Laplacian is \(L=D-A\), i.e. \(L_{ij}=\delta_{ij}D_{ii}-A_{ij}\). Its symmetric normalized form is \[ \hat L=D^{-1/2}LD^{-1/2}=I-D^{-1/2}AD^{-1/2}, \qquad \hat L_{ij}=\delta_{ij}-\frac{A_{ij}}{\sqrt{D_{ii}D_{jj}}}. \tag{7.10}\]
Why the Laplacian encodes clusters is clearest through the left-normalized variant \(\tilde L=D^{-1}L=I-D^{-1}A\): for any \(v\), \[ [\tilde Lv]_i=v_i-\frac{\sum_j A_{ij}v_j}{\sum_j A_{ij}}, \] the gap between \(v_i\) and the weighted average of its neighbours, a discrete smoothness operator, small on functions that barely change across the graph. Three facts pin the spectrum: (1) \(L\mathbf 1=0\), so the constant vector is a null eigenvector; (2) \(L\) is diagonally dominant with nonnegative diagonal; hence (3) \(L\) is positive semidefinite. For \(\hat L\) one more bound holds.
Proposition 7.2 (Spectrum of the normalized Laplacian) The eigenvalues of \(\hat L=D^{-1/2}LD^{-1/2}\) all lie in \([0,2]\).
Proof. \(\hat L\) is positive semidefinite (congruent to the PSD \(L\) via \(D^{-1/2}(\cdot)D^{-1/2}\)), so its eigenvalues are \(\ge0\). For the upper bound, \(\hat L\) is similar to \(\tilde L=D^{-1}L\) (indeed \(\tilde L=D^{-1/2}\hat LD^{1/2}\)), so they share a spectrum, and \(\spec(\tilde L)\le\ninf{\tilde L}\). Each row of \(\tilde L\) has \(1\)-norm \[ \sum_{j}\Bigl\lvert\delta_{ij}-\tfrac{A_{ij}}{D_{ii}}\Bigr\rvert \le 1+\frac{1}{D_{ii}}\sum_j A_{ij}=1+\frac{D_{ii}}{D_{ii}}=2 , \] so \(\ninf{\tilde L}\le2\) and every eigenvalue of \(\hat L\) lies in \([0,2]\). \(\square\)
For a unit vector \(v\), \[ v^\top\hat Lv=\frac12\sum_{i,j}A_{ij} \left(\frac{v_i}{\sqrt{D_{ii}}}-\frac{v_j}{\sqrt{D_{jj}}}\right)^2. \] A small eigenvalue means the degree-scaled entries \(v_i/\sqrt{D_{ii}}\) vary little across strong edges. The zero eigenvector is \(D^{1/2}\mathbf1\), since \(\hat L D^{1/2}\mathbf1=D^{-1/2}L\mathbf1=0\). For a connected graph this spans the nullspace; with several connected components, each component contributes a degree-weighted indicator vector.
Spectral embedding
A spectral embedding is a map \(\Phi:\{1,\dots,n\}\to\R^d\) sending vertex \(i\) (data point \(x_i\)) to a new point \(\Phi(i)\). Let \(Q=[v_1,\dots,v_d]\in\R^{n\times d}\) hold the orthonormal eigenvectors of the \(d\) lowest eigenvalues of \(\hat L\). Since we want the lowest eigenpairs, run subspace iteration on \(2I-\hat L\): its dominant eigenvectors are those of \(\hat L\)’s smallest eigenvalues, and this is valid precisely because \(\spec(\hat L)\subseteq[0,2]\) by Proposition 7.2 keeps \(2I-\hat L\) positive semidefinite. The embedding is \[ \Phi(i)=[Q_{i,:}]^\top\in\R^d , \] the \(i\)-th row of \(Q\). These rows retain degree-dependent magnitudes: even on a disconnected component, the corresponding null vector has entries proportional to \(\sqrt{d_i}\). A common variant normalizes each nonzero row to \(Q_{i,:}/\ntwo{Q_{i,:}}\) before clustering. This removes the row’s magnitude; the figure below uses the raw rows.
Clustering
Clustering the raw \(x_i\in\R^m\) or the embedded \(y_i=\Phi(i)\in\R^d\) gives different assignments. We split into \(k\) clusters with \(k\)-means. It posits centroids \(z_1,\dots,z_k\in\R^m\) and an assignment \(c:\{1,\dots,n\}\to\{1,\dots,k\}\), minimizing \[ F(z_1,\dots,z_k,c)=\sum_{j=1}^k\sum_{i:\,c(i)=j}\ntwo{x_i-z_j}^2 \tag{7.11}\] over both centroids and assignment.
From a random start, alternate the two closed-form minimizations until the assignment stops changing:
- Centroids (assignment fixed): \(z_j\leftarrow\dfrac{\sum_{i:\,c(i)=j}x_i}{\#\{i:c(i)=j\}}\), the cluster mean.
- Assignment (centroids fixed): \(c(i)\leftarrow\argmin_{j}\ntwo{x_i-z_j}^2\), the nearest centroid.
Each centroid or assignment update weakly decreases Equation 7.11. Different starts can reach different local minima, so several random starts can give better assignments. For the rings in Figure 7.5, the raw spectral coordinates separate the two groups that overlap in the original coordinates; this is the case where \(k\)-means benefits from the embedding.
7.7 Applications
| Problem | Matrix acted on | Eigenpairs wanted | End of spectrum | Engine |
|---|---|---|---|---|
| Markov / PageRank | chain \(P\) | eigenvalue \(1\) | dominant | power method |
| PCA | covariance \(XX^\top\) | top \(k\) | dominant | subspace iteration + Rayleigh–Ritz |
| Randomized SVD | \(AA^\top\) (and \(A^\top A\)) | top \(k\) | dominant | single random block (no iteration) |
| Spectral clustering | Laplacian \(\hat L\) | bottom \(k\) | smallest, via \(2I-\hat L\) | subspace iteration |