Spectral Decomposition

A matrix MM can be decomposed as:

M=VDVTM = V D V^T

where VV is the matrix of eigenvectors and D=diag(λ1,λ2)D = \text{diag}(\lambda_1, \lambda_2) is the diagonal matrix of eigenvalues.

To get a sense of what this means, we can image a matrix transforming a unit circle into an ellipse. To get use started, we have provided an initial transform matrix MM below.

Drag the values of M to adjust.

This notebook will illustrate the transform, and will demonstrate that the axes of the transformed circle are aligned with the eigenvectors and scaled by the eigenvalues. We can grab the "eigenvalues" and "eigenvectors" of the matrix easily with numpy.

Drag the matrix values below to see the decomposition and transform update live. Adjusting the eigenvalues in DD produces M=VDVTM^\star = V D^\star V^T.

||[\times||]||[\times||]||[=||]
See how ||(M||) transforms the unit circle, then toggle to ||(M^\star||) to see the effect of scaling the eigenvalues.

Select a region on the plot above to see translation vectors.

Aside: Area Scaling

The product of eigenvalues (||(\det(M^\star)||)) tells us how ||(M^\star||) scales area: ||[\lambda_1 \cdot \lambda_2 = 0.008 \times 1.319 = 0.010||]||[\begin{array}{l|r} & \text{Area} \ \hline \text{Unit circle} & \pi \approx 3.142 \ \text{Ellipse} & \pi ,|\lambda_1 \lambda_2| \approx 0.033 \ \text{Scale factor} & 0.010\times \end{array}||]Orientation is preserved (sign of ||(\det(M^\star)||)).