Eigenvalues and eigenvectors
Formal
(Eigenvalues and Eigenvectors)
Let be a square matrix. Then is an eigenvalue of and is the corresponding eigenvector of if
(Theorem)
Proof
-
The equation for an eigenvector is
Ax = λx. Rearranging it gives us:(A - λI)x = 0 -
Let’s call the new matrix
M = (A - λI). The equation is nowMx = 0. -
This equation asks a simple question: “What vectors x does the transformation M send to the zero vector?” For any matrix
M, the zero vector (x = 0) is always a solution. -
This is the “trivial” solution. But by definition, an eigenvector must be non-zero.
-
So, for
λto be a valid eigenvalue, there must be some non-zero vectorxthat the matrixM = (A - λI)squashes completely down to the origin. -
What kind of transformation can squash a non-zero vector to zero? Only a transformation that is “destructive”—one that collapses the space. A transformation that collapses space loses at least one dimension.
(Collinearity and Codirection)
Two vectors that point in the same direction are called codirected. Two vectors are collinear if they point in the same or the opposite direction.
(Theorem):
is an eigenvalue of if and only if is a root of the characteristic polynomial of . ref: Characteristic Polynomial
(Eigenspace and Eigenspectrum)
For , the set of all eigenvectors of associated with an eigenvalue span a subspace of , which is called the eigenspace of w.r.t. and is denoted by . The set of all eigenvalues of is called eigenspectrum of .
Proof
Any can be represented as where are eigenvectors of w.r.t. . (take only two eigenvectors here, easy to extend to a higher number of eigenvectors w.r.t. )
(Geometric multiplicity)
The dimension of the eigenspace is called the geometric multiplicity of the eigenvalue . It tells you how many linearly independent eigenvectors exist for that eigenvalue.
(Theorem)
The eigenvectors of a matrix with distinct eigenvalues are linearly independent.
Proof
Imagine you have two eigenvectors corresponding to two eigenvalues for a transformation matrix . Suppose that they are not linearly independent. This means that . But, if is a multiple of (viz., they are pointing in the same direction) then the matrix would have to stretch them by same value (definition of Eigenvalue). Hence, we arrive at a contradiction and .
(Defective Matrices)
A square matrix is said to be defective if it possesses fewer than linearly independent eigenvectors.
Defective matrices hinder with matrix decomposition.
- This is due to the implication that for the decomposition of for , a linearly independent set of eigenvectors guarantees that is a diagonal matrix.
- But if P is still invertible, we can still get a decomposition of the form where is kind of diagonal but not completely. Note that decomposition is ideal but always exists when is invertible.
(Spectral Theorem)
If is symmetric, there exists an orthonormal basis of the corresponding vector space consisting of eigenvectors of , and each eigenvalue is real. Due to Angles and Orthogonality, this leads to a supercharged decomposition of the form (since ).
(Theorem)
The determinant of a square matrix is the product of its eigenvalues. (think of it from volume perspective)
The trace of the matrix is the sum of the eigenvalues.
Intuition
Decomposition the the overall objective of all these concepts.
How defectiveness hinders decomposition
Geometrically, eigendecomposition finds the axes along which the transformation matrix acts purely by stretching/shrinking. A defective matrix, however, represents a transformation that includes shearing. Shearing skews the space in a way that cannot be represented merely by scaling along fixed axes.
Imagine a linear transformation as a function that takes a vector and maps it to a new vector. For a given transformation matrix A, most vectors will be knocked off their original direction when multiplied by A. However, there exist special vectors, eigenvectors, that do not change their direction under this transformation. They are only scaled—stretched, shrunk, or flipped. The factor by which an eigenvector is scaled is its corresponding eigenvalue.
Think of it this way: applying a linear transformation to a vector space is like stretching or rotating a sheet of rubber. The eigenvectors are the directions that are only stretched or shrunk, not rotated. The eigenvalue tells you how much stretching or shrinking occurs in that direction.
This concept is crucial because it allows us to identify the principal axes of a transformation, the directions along which the transformation acts purely by scaling. In machine learning, this is invaluable for understanding the variance in data and for dimensionality reduction.
ML Applications
Eigenvalues and eigenvectors are not just mathematical curiosities; they are at the heart of many machine learning algorithms and concepts:
- Principal Component Analysis (PCA): In PCA, eigenvectors of the covariance matrix of the data are the principal components. The eigenvalues give the variance of the data along these principal components. By selecting the eigenvectors with the largest eigenvalues, you can reduce the dimensionality of the data while preserving the most variance. This is a cornerstone of dimensionality reduction.
- Understanding Data Variance: Eigen-decomposition of a covariance matrix reveals the directions of maximum variance in your data. This is crucial for understanding the structure of your data and for feature engineering.
- Spectral Clustering: This clustering technique uses the eigenvectors of a similarity matrix of the data to perform dimensionality reduction before clustering in a lower-dimensional space.
- Google’s PageRank Algorithm: The PageRank of a webpage is related to the eigenvector of the link matrix of the web, corresponding to the largest eigenvalue.