Eigenvalues and Diagonalization
Plot size against rent for a few hundred flats and the dots form a long cloud tilted up and to the right. The direction the cloud stretches along, and how far it stretches, are an eigenvector and an eigenvalue. Principal component analysis, a standard way to shrink many features into a few, is built on exactly this.
The rule
An eigenvector keeps its direction; its eigenvalue says how much it stretches.
Most vectors change direction when a matrix acts on them. A few special ones only get longer, shorter or flipped. For those, : is the eigenvector and the number is its eigenvalue.
Take :
- : . Same direction, stretched by 3, so .
- : . Same direction, stretched by 1, so .
- : . The direction changed, so this is not an eigenvector.
Diagonalization rewrites the matrix using its eigenvectors: , where the columns of are the eigenvectors and is diagonal with the eigenvalues. In eigenvector coordinates the matrix is just "stretch each axis". That makes powers easy: , and a diagonal matrix is raised to a power one entry at a time.
Covariance matrices, which describe how features vary together, are symmetric. Symmetric matrices always have real eigenvalues and perpendicular eigenvectors, which is why PCA can use them as new axes: the eigenvector with the largest eigenvalue points where the data spreads most.