ContentsChapter 1 · Linear algebra6 of 7

1.6

Eigenvectors and eigenvalues

In this chapter
  1. 1.1Vectors and linear combinations
  2. 1.2Span, basis and dimension
  3. 1.3Matrices as transformations
  4. 1.4Determinant, inverse and Ax = b
  5. 1.5Dot products, angles and projections
  6. 1.6Eigenvectors and eigenvalues
  7. 1.7Symmetric matrices and the SVD
Before you readA matrix stretches and shears the plane. Are there any directions it leaves pointing the same way?
Watch: Eigenvectors and eigenvalues · 3Blue1Brown · Essence of Linear Algebra, ch. 14

Most vectors get knocked off their line by a transformation. An eigenvector is one that stays on its line and only gets scaled:

Av=λv,v≠0.Av = \lambda v, \qquad v \neq 0.

The scale factor λ\lambda is its eigenvalue.

A = [[4, 1], [2, 3]]λ = 5, v = (0.71, 0.71); λ = 2, v = (0.45, -0.89)
x sweeps round a circle and Ax follows. When Ax turns blue it lies on the line through x: x is an eigenvector and λ is the stretch.

Finding them. Av=λvAv = \lambda v means (A−λI)v=0(A - \lambda I)v = 0 for a non-zero vv so A−λIA - \lambda I must squash space: det⁡(A−λI)=0\det(A - \lambda I) = 0 For A=[4123]A = \begin{bmatrix} 4 & 1 \\ 2 & 3 \end{bmatrix}

(4−λ)(3−λ)−2=λ2−7λ+10=0  ⇒  λ=5,2.(4 - \lambda)(3 - \lambda) - 2 = \lambda^2 - 7\lambda + 10 = 0 \;\Rightarrow\; \lambda = 5, 2.

Then solve (A−λI)v=0(A - \lambda I)v = 0 for each: λ=5\lambda = 5 gives v=(1,1)v = (1, 1) λ=2\lambda = 2 gives v=(1,−2)v = (1, -2)

Three edge cases. An eigenvalue can be 00 then Av=0Av = 0 and AA squashes vv to the origin. For A=cIA = cI every non-zero vector is an eigenvector. And a rotation has no real eigenvalues, so no line through the origin stays put.

A shortcut for 2×22\times2 the eigenvalues add to the trace a+da + d and multiply to det⁡A\det A

Watch: A quick trick for computing eigenvalues · 3Blue1Brown · Essence of Linear Algebra, ch. 15

Why ML cares: PCA’s principal components are eigenvectors of the covariance matrix, and their eigenvalues are how much variance each direction carries.

Recall
What is an eigenvector of AA
Recall
Which equation gives the eigenvalues of AA
Recall
For a 2×22\times2 matrix, what do the eigenvalues sum and multiply to?
Exercise
Find both eigenvalues of [3−4−2−1]\begin{bmatrix} 3 & -4 \\ -2 & -1 \end{bmatrix} to two decimal places.
Exercise
A=[1232]A = \begin{bmatrix} 1 & 2 \\ 3 & 2 \end{bmatrix} has eigenvalue 44 Find an eigenvector for it, scaled so its first entry is 1.