1.3
Matrix Diagonalization and Spectral Theorem
[MIT 18.05] Matrix Methods in Data Analysis, Signal Processing, and Machine Learning
Junseo Lee
Eigenvalues and Eigenvectors
Eigenvalues and Eigenvectors
For a matrix , we have . We call an eigenvector of and an eigenvalue of .
A
Axλx
x
A
λ
A
We can immediately see that the eigenvector doesn’t change direction when multiplied by the matrix .
In other words, the output is on the same line as the input vector , since it is just multiplied by its eigenvalue .
x
A
In other words, the output
Ax
x
λ
Computing the Eigenvalues
Computing the Eigenvalues
Note that is equivalent to .
In order for this homogeneous linear system to have nontrivial solutions (since we are mostly interested in the nonzero eigenvectors), the coefficient matrix must be singular, which means its determinant must be zero. The equation is an th degree equation for and has roots, which means we have eigenvalues. We call this equation the characteristic equation for matrix .
Axλx
(A-λI)x0
In order for this homogeneous linear system to have nontrivial solutions (since we are mostly interested in the nonzero eigenvectors), the coefficient matrix
A-λI
det(A-λI)0
n
λ
n
n
A
Example
Example
Find the eigenvalues and eigenvectors of
8 | 3 |
2 | 7 |
In[]:=
A = {{8, 3}, {2, 7}};% // MatrixForm
Out[]//MatrixForm=
8 | 3 |
2 | 7 |
In[]:=
(* Create a 2 by 2 identity matrix *)I2 = IdentityMatrix[2];% // MatrixForm
Out[]//MatrixForm=
1 | 0 |
0 | 1 |
Characteristic equation and eigenvalues
We can find the characteristic equation of our matrix by computing the determinant of
A
A-λI
In[]:=
fλ = Det[A - λ I2] == 0
Out[]=
50-15λ+0
2
λ
We can see that the characteristic equation is a 2nd degree equation for .
Now, let us solve this equation to find the eigenvalues of
λ
Now, let us solve this equation to find the eigenvalues of
A
In[]:=
Solve[fλ, λ]
Out[]=
{{λ5},{λ10}}
Thus, there are two eigenvalues of and .
λ5
λ10
Alternatively, we can use the built-in Wolfram function to find the eigenvalues of directly.
Eigenvalues[]
A
In[]:=
Eigenvalues[A]
Out[]=
{10,5}
Eigenvectors corresponding to each eigenvalue
Next, we can find the corresponding eigenvectors of by solving the system for .
A
(A-λI)x0
x
First for ,
λ5
In[]:=
NullSpace[A - 5 I2]
Out[]=
{{-1,1}}
We have the eigenvector
corresponding to .
x
1
-1 |
1 |
λ5
Next, for ,
λ10
In[]:=
NullSpace[A - 10 I2]
Out[]=
{{3,2}}
We have the eigenvector
corresponding to .
x
2
3 |
2 |
λ10
Alternatively, we can use the built-in Wolfram function to find the eigenvectors of directly.
Eigenvectors[]
A
In[]:=
Eigenvectors[A]
Out[]=
{{3,2},{-1,1}}
Similar Matrices and Diagonalization
Similar Matrices and Diagonalization
Similar Matrices
Similar Matrices
For every invertible matrix , the eigenvalues of are the same as the eigenvalues of . The eigenvectors of are multiplied by to give eigenvectors of
B
BA
-1
B
A
x
A
B
Bx
BA
-1
B
If , then .
Axλx
(BA)(Bx)BAxBλxλ(Bx)
-1
B
We say that matrices are “similar” to .
BA
-1
B
A
Diagonalization Problem
Diagonalization Problem
Given a square matrix A, can we find an invertible matrix such that AXD where is a diagonal matrix?
X
-1
X
D
If such a matrix exists, then is said to be diagonalizable and is said to diagonalize A.
A
X
Suppose a square matrix has a full set of independent eigenvectors.
Put those eigenvectors,…, as columns of an invertible matrix .
A
n
Put those eigenvectors
x
1
x
n
X
X
x 1 | … | x n |
Then, multiply column by column to get the columns to , which can be split into times , which is a diagonal matrix with eigenvalues of .
AX
λ
1
x
1
λ
n
x
n
X
Λ
A
A
x 1 | … | x n |
A x 1 | … | A x n |
λ 1 x 1 | … | λ n x n |
x 1 | … | x n |
λ 1 | ||
⋱ | ||
λ n |
Simplifying, .
AXXΛ
Multiply from left to both sides, and we have AXΛ where is a diagonal matrix.
-1
X
-1
X
Λ
Alternatively, we could think of it as a factorization of into .
A
AXΛ
-1
X
Theorem
Theorem
An matrix is diagonalizable if and only if has linearly independent eigenvectors.
nn
A
A
n
Example
Example
Given the matrix , decompose into .
A
8 | 3 |
2 | 7 |
A
XΛ
-1
X
In[]:=
A = {{8, 3}, {2, 7}}
Out[]=
{{8,3},{2,7}}
Firstly, find the eigenvalues of and form the diagonal eigenvalue matrix .
A
Λ
In[]:=
Λ
Out[]=
{{10,0},{0,5}}
Next, find the set of eigenvectors of , and form the invertible eigenvector matrix .
A
X
In[]:=
X = Transpose[Eigenvectors[A]];% // MatrixForm
Out[]//MatrixForm=
3 | -1 |
2 | 1 |
Find the inverse of .
X
In[]:=
Xinv = Inverse[X]
Out[]=
,,-,
1
5
1
5
2
5
3
5
Multiply to get
XΛ
-1
X
A
In[]:=
X..Xinv
Λ
Out[]=
{{8,3},{2,7}}
This matrix is the same as .
A
In[]:=
A == X..Xinv
Λ
Out[]=
True
Spectral Theorem
Spectral Theorem
Orthogonal Matrices
Orthogonal Matrices
An orthogonal matrix is a square matrix whose columns are orthonormal. It has the property , and therefore, QI and .
Q
T
Q
-1
Q
T
Q
QI
T
Q
The columns of this orthogonal matrix are an orthonormal basis for , and the rows of also form an orthonormal basis for .
nn
n
R
Q
n
R
Example
Example
As expected, the result is an identity matrix of size 2.
Remark
Remark
A matrix is orthogonally diagonalizable if and only if it is symmetric.
Example
Example
Beautiful! We have an diagonal matrix with eigenvalues.