Eigenvalues and eigenvectors

core 11 mindecompositionseigenvaluesspectral

Builds on:Matrices transform space

The idea

A matrix transforms space: generic vectors get stretched and rotated somewhere new. An eigenvector is a direction the matrix does not rotate — it stays on its own line and is only scaled by the eigenvalue:

Av=λv,v≠0Av = \lambda v, \qquad v \neq 0

Why this is the single most reused idea in applied linear algebra: along an eigen-direction, the matrix behaves like multiplication by a plain number. If you can find a whole basis of eigenvectors, the matrix is just a list of numbers in the right coordinate system:

A=QΛQ−1A = Q \Lambda Q^{-1}

with eigenvectors in the columns of QQ and eigenvalues on the diagonal of Λ\Lambda. A coupled dd-dimensional linear system becomes dd independent one-dimensional ones. Powers collapse to Ak=QΛkQ−1A^k = Q \Lambda^k Q^{-1}, which is why the largest-magnitude eigenvalue controls the fate of every repeated linear process: Markov chains, PageRank, gradient descent dynamics, RNN state propagation. Bigger than one in magnitude → explosion; smaller → decay.

To compute by hand, rearrange Av=λvAv = \lambda v into (A−λI)v=0(A - \lambda I)v = 0: a nonzero solution exists only when A−λIA - \lambda I is singular, giving the characteristic equation

det⁡(A−λI)=0\det(A - \lambda I) = 0

For the matrices data scientists actually meet — covariance, correlation, kernel/Gram matrices, graph Laplacians, Hessians — there is a bonus, the spectral theorem: symmetric matrices have real eigenvalues and an orthonormal eigenbasis, A=QΛQ⊤A = Q \Lambda Q^\top. Covariance matrices are additionally positive semidefinite (w⊤Σw=Var(w⊤x)≥0w^\top \Sigma w = \mathrm{Var}(w^\top x) \ge 0), so their eigenvalues are nonnegative and readable as variances along perpendicular axes — the fact PCA is built on.

Play with a symmetric matrix directly — the eigenvector rays stay fixed in place as the unit circle stretches into an ellipse around them:

[[2, 1], [1, 1]] stretches the unit circle along its eigenvector rays by λ₁ = 2.62 and λ₂ = 0.38.

Worked example

Take the symmetric matrix

A=[2112]A = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix}

Eigenvalues. The characteristic polynomial factors as

det⁡(A−λI)=(2−λ)2−1=λ2−4λ+3=(λ−3)(λ−1).\begin{aligned} \det(A - \lambda I) &= (2-\lambda)^2 - 1 \\ &= \lambda^2 - 4\lambda + 3 \\ &= (\lambda - 3)(\lambda - 1). \end{aligned}

Thus λ1=3\lambda_1 = 3 and λ2=1\lambda_2 = 1. The trace and determinant checks are

tr⁡(A)=4=3+1,det⁡(A)=3=3×1.\operatorname{tr}(A) = 4 = 3 + 1, \qquad \det(A) = 3 = 3 \times 1.

Eigenvectors. Solve each null-space equation:

λ1=3:−v1+v2=0⇒v(1)=(1,1),λ2=1:v1+v2=0⇒v(2)=(1,−1).\begin{aligned} \lambda_1 = 3:&\quad -v_1 + v_2 = 0 &&\Rightarrow v^{(1)} = (1,1), \\ \lambda_2 = 1:&\quad v_1 + v_2 = 0 &&\Rightarrow v^{(2)} = (1,-1). \end{aligned}

Verification is immediate:

A(1,1)=(3,3)=3(1,1),A(1,−1)=(1,−1).A(1,1) = (3,3) = 3(1,1), \qquad A(1,-1) = (1,-1).

The two eigenvectors are orthogonal, exactly as the spectral theorem promises for a symmetric matrix.

Geometry. AA stretches space by 33 along the diagonal direction (1,1)(1,1) and leaves the anti-diagonal (1,−1)(1,-1) untouched. If AA were a covariance matrix, PCA would report first component (1,1)/2(1,1)/\sqrt{2} with variance 33 and second component (1,−1)/2(1,-1)/\sqrt{2} with variance 11.

Power iteration in miniature. Start from the non-eigenvector (1,0)(1, 0) and apply AA repeatedly:

(1,0)→(2,1)→(5,4)→(14,13)(1,0) \to (2,1) \to (5,4) \to (14,13)

The ratio of coordinates goes 2.0,1.25,1.08,⋯→12.0, 1.25, 1.08, \dots \to 1: the iterates swing toward the dominant eigen-direction (1,1)(1,1), and each step multiplies the components along (1,1)(1,1) and (1,−1)(1,-1) by 33 and 11 respectively, so the dominant one wins at rate λ2/λ1=1/3\lambda_2/\lambda_1 = 1/3 per step.

Cheat sheet

Definitions and hand computation

Where each fact earns money

AppearanceEigen-fact doing the work
PCAcovariance eigenvectors = variance axes; eigenvalues = variances
PageRank / power iterationdominant eigenvector; converges at rate ∣λ2/λ1∣\lvert \lambda_2/\lambda_1 \rvert
Markov chainsstationary distribution = left eigenvector for λ=1\lambda = 1 of PP (equivalently the right eigenvector of P⊤P^\top) — the right eigenvector of PP for λ=1\lambda = 1 is just the all-ones vector
Gradient descent / Hessianpositive definite Hessian = local min; κ=λmax⁡/λmin⁡\kappa = \lambda_{\max}/\lambda_{\min} sets step-size and convergence speed
Multicollinearitynear-zero covariance eigenvalue = redundant feature combination
Spectral clusteringsmall eigenvalues of graph Laplacian reveal cluster structure

Gotchas