A matrix moves every vector — rotating it, stretching it, shearing it. But almost every matrix has a few special directions it cannot rotate: vectors it can only stretch or flip. Those are the eigenvectors, and the stretch factors are the eigenvalues. They are the matrix's skeleton — and the entire reason PCA works.
Below, a wheel of unit vectors (faint) and where the matrix A sends each one (bold).
Drag the sliders and watch: most spokes get rotated — their output points in a different
direction than the input. But look for the spokes where input and output line up perfectly. Along those
directions the matrix behaves like simple multiplication by a number:
Av = λv.
No rotation, just scale. That number λ is the eigenvalue; the direction v is the eigenvector.
The default matrix is the classic [[1,8],[2,1]]. Its eigen-directions are drawn in
green and amber — notice the bold arrows along them sit exactly on top of the direction line, just
longer (λ=5: stretched 5×) or flipped and shrunk (λ=−3: reversed and 3×). Now try
[[2,0],[0,3]]: a pure axis-scaling — the axes themselves are the eigenvectors, and the
eigenvalues are sitting right there on the diagonal. Then try a rotation-like matrix
(a=0,b=-1,c=1,d=0): the lines disappear, because a pure rotation rotates everything —
its eigenvalues are complex, and there is no real direction it leaves alone.
Asking "which v satisfies Av = λv?" rearranges to
(A − λI)v = 0 — a matrix
squashing a non-zero vector to zero. From the matrix explainer
you know what that means: the matrix A − λI must collapse space, i.e.
det(A − λI) = 0. For a 2×2 that determinant is a quadratic in λ — the characteristic
equation λ² − tr(A)λ + det(A) = 0. Two roots, two eigenvalues, and each one's
eigenvector falls out of the collapsed matrix. For the default matrix:
where tr(A) = a+d (sum of the diagonal), det(A) = ad−bc, for the default matrix [[1,8],[2,1]]
ⓘ characteristic equation on Wikipedia ↗That's the whole by-hand recipe.
Feed any vector through A again and again and something remarkable happens: the component
along the largest eigenvalue's direction grows fastest (×5 each step here, vs ×3 for the other),
so the vector swings toward the dominant eigenvector. This is power iteration — it's how Google's
original PageRank found "the important pages" of the web (the dominant eigenvector of the link matrix),
and it's the intuition for why long-run behaviour of any repeated linear process is governed by its top
eigenvalue.
Curated companion: Setosa — Eigenvectors and Eigenvalues.