Blog Post
Eigenvalues and Eigenvectors
Most vectors get rotated and scaled when multiplied by a matrix. Eigenvectors are the special directions that only get scaled — and their scaling factors, the eigenvalues, reveal everything about a matrix's long-term behavior.
Views: –7 min readCite
When you run PCA on a dataset, you get back a set of directions called principal components. These are the axes of greatest variance in your data. But where do they come from?
The answer: they are the eigenvectors of the covariance matrix. The variance along each direction is the corresponding eigenvalue.
This post builds that intuition from the ground up — starting with the definition and ending with why eigenvectors are everywhere in applied math.
The Core Idea
Multiply any random vector by a matrix, and in general two things happen: the vector gets scaled and rotated. The direction changes.
But some special vectors only get scaled — their direction is unchanged. These are eigenvectors.
Formally, a nonzero vector is an eigenvector of matrix if:
The scalar is the corresponding eigenvalue. The matrix acts on purely as multiplication by — a stretch or shrink (or flip, if ).
Try it with the visualizer below. Fan out vectors in all directions and watch where maps each one. The eigenvector directions (highlighted in gold) are the ones that stay on the same line through the origin after transformation.
Move your cursor over the diagram — white vector is your direction, colored vector is where A maps it. Gold = eigenvector.
Finding Eigenvalues
We want to find all such that has a nonzero solution .
Rearrange:
For this to have a nonzero solution, must be singular (non-invertible). That happens exactly when its determinant is zero:
This is the characteristic equation. Expanding it gives a polynomial in called the characteristic polynomial — its roots are the eigenvalues.
A 2×2 Example
Let .
Setting this to zero: , giving and .
For a general symmetric 2×2 matrix , the characteristic polynomial is:
The slider below lets you explore how the polynomial changes as you vary the matrix entries, and where the eigenvalues land on the -axis.
Matrix: [[3.0, 1.0], [1.0, 2.0]]. Gold dots are eigenvalue roots of the characteristic polynomial.
Finding Eigenvectors
Once you have an eigenvalue , find its eigenvectors by solving:
This is a homogeneous system — it always has the trivial solution , but we want nonzero solutions.
Continuing our example with :
For :
Row reduce: both rows say . So (any scalar multiple works).
For :
This says , so . Eigenvector: .
You can verify: ✓ and ✓.
Geometric Intuition
Think of a matrix transformation as a machine that distorts space. Most directions get bent — a vector pointing northeast might end up pointing northwest.
Eigenvectors are the invariant axes of the transformation. Along these directions, the machine acts like a simple number line stretch. Everything else in the space is some linear combination of these special directions, so understanding what happens along eigenvectors tells you everything about the transformation.
For a 2×2 matrix with two distinct eigenvectors and , any vector can be written as:
Applying :
The transformation just scales each component independently along its eigenvector axis. That's why diagonalizing a matrix (expressing it in the eigenvector basis) simplifies everything.
Eigenvalues and Stability
The magnitude of tells you whether the transformation expands or contracts along that eigenvector direction:
- : expansion — vectors along this direction grow
- : contraction — vectors shrink toward zero
- : neutral — vectors maintain their length
- : flip — the direction reverses, then scales by
- : collapse — the entire eigenvector direction maps to zero
This is the foundation of dynamical systems analysis. If you model a system as , the eigenvalues of determine whether the system eventually stabilizes, grows without bound, or oscillates.
Power Iteration: How Eigenvalues Emerge Naturally
Apply to a random vector repeatedly:
Write . Then:
If one eigenvalue dominates — say for all — then as , the term swamps the rest. After normalization, the vector converges to , the dominant eigenvector.
This is the power iteration algorithm. It's why gradient descent and PageRank work the way they do.
Power iteration: repeatedly apply A and normalize. The vector (green) converges to the dominant eigenvector (gold dashed line).
Real-World Applications
Google PageRank
The web can be modeled as a giant matrix where represents the probability of jumping from page to page . PageRank is defined as the stationary distribution of a random walk on this graph.
Stationary distribution means: after multiplying by forever, the distribution doesn't change. That's exactly:
So is an eigenvector of with eigenvalue . Google's original algorithm was literally power iteration on a billion-node matrix.
Principal Component Analysis (PCA)
Given data matrix (mean-centered), the covariance matrix is .
PCA finds the directions of greatest variance in the data. These directions are the eigenvectors of , and the variance along each direction is the corresponding eigenvalue.
Why? Variance in direction is . To maximize this subject to , use Lagrange multipliers — the optimal satisfies . Eigenvalue equation, exactly.
The first principal component is the eigenvector with the largest eigenvalue. It explains the most variance.
Symmetric Matrices: A Special Case
Symmetric matrices () have two remarkable properties:
- All eigenvalues are real — even if the matrix entries are real, some matrices have complex eigenvalues; symmetric matrices never do.
- Eigenvectors for distinct eigenvalues are orthogonal — the eigenvector axes are perpendicular to each other.
Proof of orthogonality: Let and with . Then:
Since , we need . They're orthogonal.
This leads to the spectral theorem: every symmetric matrix can be decomposed as:
where is an orthogonal matrix (its columns are the eigenvectors) and is diagonal (the eigenvalues). Every symmetric transformation is just a rotation, independent scaling along axes, and rotation back. Clean, beautiful, and the foundation of SVD.
The covariance matrix in PCA is symmetric — which is why PCA eigenvectors are orthogonal principal components.
Summary
| Concept | Key Fact |
|---|---|
| Eigenvector equation | |
| Finding eigenvalues | |
| Characteristic polynomial (2×2) | |
| $ | \lambda |
| $ | \lambda |
| Direction flip | |
| Symmetric matrices | Real eigenvalues, orthogonal eigenvectors |
| PCA | Eigenvectors of covariance matrix |
| PageRank | Eigenvector with |
Next up: Singular Value Decomposition — what happens when a matrix isn't square, and why SVD generalizes eigendecomposition to all matrices.