Eigenvalues and Eigenvectors Few concepts to remember from linear - - PowerPoint PPT Presentation
Eigenvalues and Eigenvectors Few concepts to remember from linear - - PowerPoint PPT Presentation
Eigenvalues and Eigenvectors Few concepts to remember from linear algebra Let be an matrix and the linear transformation = Rank: maximum number of linearly independent
Few concepts to remember from linear algebra
Let ๐ฉ be an ๐ร๐ matrix and the linear transformation ๐ = ๐ฉ๐
- Rank: maximum number of linearly independent columns or rows of ๐ฉ
- Range ๐ฉ = ๐ = ๐ฉ๐ โ๐}
- Null ๐ฉ = ๐ ๐ฉ๐ = ๐}
๐ โ โ๐ โ
๐ฉ ๐ โ โ๐
Eigenvalue problem
Let ๐ฉ be an ๐ร๐ matrix: ๐ โ ๐ is an eigenvector of ๐ฉ if there exists a scalar ๐ such that ๐ฉ ๐ = ๐ ๐ where ๐ is called an eigenvalue. If ๐ is an eigenvector, then ฮฑ๐ is also an eigenvector. Therefore, we will usually seek for normalized eigenvectors, so that ๐ = 1 Note: When using Python, numpy.linalg.eig will normalize using p=2 norm.
How do we find eigenvalues?
Linear algebra approach: ๐ฉ ๐ = ๐ ๐ ๐ฉ โ ๐ ๐ฑ ๐ = ๐ Therefore the matrix ๐ฉ โ ๐ ๐ฑ is singular โน ๐๐๐ข ๐ฉ โ ๐ ๐ฑ = 0 ๐ ๐ = ๐๐๐ข ๐ฉ โ ๐ ๐ฑ is the characteristic polynomial of degree ๐. In most cases, there is no analytical formula for the eigenvalues of a matrix (Abel proved in 1824 that there can be no formula for the roots
- f a polynomial of degree 5 or higher) โน Approximate the
eigenvalues numerically!
Example
Notes: The matrix ๐ฉ is singular (det(A)=0), and rank(๐ฉ)=1 The matrix has two distinct real eigenvalues The eigenvectors are linearly independent
๐ฉ = 2 1 4 2 ๐๐๐ข 2 โ ๐ 1 4 2 โ ๐ = 0
Solution of characteristic polynomial gives: ๐. = 4, ๐/ = 0 To get the eigenvectors, we solve: ๐ฉ ๐ = ๐ ๐
2 โ (4) 1 4 2 โ (4) ๐ฆ$ ๐ฆ% = 0 ๐ = 1 2 2 โ (0) 1 4 2 โ (0) ๐ฆ$ ๐ฆ% = 0 ๐ = โ1 2
Diagonalizable Matrices
A ๐ร๐ matrix ๐ฉ with ๐ linearly independent eigenvectors ๐ is said to be diagonalizable. ๐ฉ ๐๐ = ๐. ๐๐, ๐ฉ ๐๐ = ๐/ ๐๐, โฆ ๐ฉ ๐๐ = ๐; ๐๐, In matrix form:
๐ฉ ๐๐ โฆ ๐๐ = ๐#๐๐ โฆ ๐$๐๐ = ๐๐ โฆ ๐๐ ๐# โฑ ๐$ This corresponds to a similarity transformation ๐ฉ๐ฝ = ๐ฝ๐ฌ โบ ๐ฉ = ๐ฝ๐ฌ๐ฝ%๐
Example
๐ฉ = 2 1 4 2 ๐๐๐ข 2 โ ๐ 1 4 2 โ ๐ = 0
Solution of characteristic polynomial gives: ๐. = 4, ๐/ = 0 To get the eigenvectors, we solve: ๐ฉ ๐ = ๐ ๐
2 โ (4) 1 4 2 โ (4) ๐ฆ$ ๐ฆ% = 0 ๐ = 1 2 2 โ (0) 1 4 2 โ (0) ๐ฆ$ ๐ฆ% = 0 ๐ = โ1 2
๐ฉ = ๐ฝ๐ฌ๐ฝ<. ๐ฝ = 0.447 0.894 โ0.447 0.894
- r normalized
eigenvector (๐ = 2 norm) ๐ = 0.447 0.894 ๐ = โ0.447 0.894
๐ฌ = 4 Notes: The matrix ๐ฉ is singular (det(A)=0), and rank(๐ฉ)=1 Since ๐ฉ has two linearly independent eigenvectors, the matrix ๐ฝ is full rank, and hence, the matrix ๐ฉ is diagonalizable.
Example
The eigenvalues of the matrix: ๐ฉ = 3 โ18 2 โ9 are ๐. = ๐/ = โ3. Select the incorrect statement: A) Matrix ๐ฉ is diagonalizable B) The matrix ๐ฉ has only one eigenvalue with multiplicity 2 C) Matrix ๐ฉ has only one linearly independent eigenvector D) Matrix ๐ฉ is not singular
Letโs look back at diagonalizationโฆ
1) If a ๐ร๐ matrix ๐ฉ has ๐ linearly independent eigenvectors ๐ then ๐ฉ is diagonalizable, i.e., ๐ฉ = ๐ฝ๐ฌ๐ฝ<๐ where the columns of ๐ฝ are the linearly independent normalized eigenvectors ๐ of ๐ฉ (which guarantees that ๐ฝ<๐ exists) and ๐ฌ is a diagonal matrix with the eigenvalues of ๐ฉ. 2) If a ๐ร๐ matrix ๐ฉ has less then ๐ linearly independent eigenvectors, the matrix is called defective (and therefore not diagonalizable). 3) If a ๐ร๐ symmetric matrix ๐ฉ has ๐ distinct eigenvalues then ๐ฉ is diagonalizable.
A ๐ร๐ symmetric matrix ๐ฉ with ๐ distinct eigenvalues is diagonalizable. Suppose ๐,๐ and ๐, ๐ are eigenpairs of ๐ฉ ๐ ๐ = ๐ฉ๐ ๐ ๐ = ๐ฉ๐ ๐ ๐ = ๐ฉ๐ โ ๐ 1 ๐ ๐ = ๐ 1 ๐ฉ๐ ๐ ๐ 1 ๐ = ๐ฉ๐ผ๐ 1 ๐ = ๐ฉ ๐ 1 ๐ = ๐ ๐ 1 ๐ โ ๐ โ ๐ ๐ 1 ๐ = 0 If all ๐ eigenvalues are distinct โ ๐ โ ๐ โ 0 Hence, ๐ 1 ๐ = 0, i.e., the eigenvectors are orthogonal (linearly independent), and consequently the matrix ๐ฉ is diagonalizable. Note that a diagonalizable matrix ๐ฉ does not guarantee ๐ distinct eigenvalues.
Some things to remember about eigenvalues:
- Eigenvalues can have zero value
- Eigenvalues can be negative
- Eigenvalues can be real or complex numbers
- A ๐ร๐ real matrix can have complex eigenvalues
- The eigenvalues of a ๐ร๐ matrix are not necessarily unique. In fact,
we can define the multiplicity of an eigenvalue.
- If a ๐ร๐ matrix has ๐ linearly independent eigenvectors, then the
matrix is diagonalizable
How can we get eigenvalues numerically?
Assume that ๐ฉ is diagonalizable (i.e., it has ๐ linearly independent eigenvectors ๐). We can propose a vector ๐ which is a linear combination of these eigenvectors: ๐ = ๐ฝ#๐# + ๐ฝ'๐' + โฏ + ๐ฝ$๐$ Then we evaluate ๐ฉ ๐: ๐ฉ ๐ = ๐ฝ#๐ฉ๐# + ๐ฝ'๐ฉ๐' + โฏ + ๐ฝ$๐ฉ๐$ And since ๐ฉ๐# = ๐#๐# we can also write: ๐ฉ ๐ = ๐ฝ#๐#๐# + ๐ฝ'๐'๐' + โฏ + ๐ฝ$๐$๐$ where ๐( is the eigenvalue corresponding to eigenvector ๐( and we assume |๐#| > |๐'| โฅ |๐)| โฅ โฏ โฅ |๐$|
Power Iteration
Our goal is to find an eigenvector ๐( of ๐ฉ. We will use an iterative process, where we start with an initial vector, where here we assume that it can be written as a linear combination of the eigenvectors of ๐ฉ. ๐* = ๐ฝ#๐# + ๐ฝ'๐' + โฏ + ๐ฝ$๐$ And multiply by ๐ฉ to get: ๐# = ๐ฉ ๐* = ๐ฝ#๐#๐# + ๐ฝ'๐'๐' + โฏ + ๐ฝ$๐$๐$ ๐' = ๐ฉ ๐# = ๐ฝ# ๐# '๐# + ๐ฝ' ๐' '๐' + โฏ + ๐ฝ$ ๐$ '๐$ โฎ ๐+ = ๐ฉ ๐+%# = ๐ฝ# ๐# +๐# + ๐ฝ' ๐' +๐' + โฏ + ๐ฝ$ ๐$ +๐$ Or rearrangingโฆ ๐+ = ๐# + ๐ฝ#๐# + ๐ฝ' ๐' ๐#
+
๐' + โฏ + ๐ฝ$ ๐$ ๐#
+
๐$
Power Iteration
๐B = ๐. B ๐ฝ.๐. + ๐ฝ/ ๐/ ๐.
B
๐/ + โฏ + ๐ฝ; ๐; ๐.
B
๐; Assume that ๐ฝ. โ 0, the term ๐ฝ.๐. dominates the others when ๐ is very large. Since |๐. > |๐/ , we have C!
C" B
โช 1 when ๐ is large Hence, as ๐ increases, ๐B converges to a multiple of the first eigenvector ๐., i.e., lim
BโD ๐# C" # = ๐ฝ.๐. or ๐B โ ๐ฝ. ๐. B ๐.
How can we now get the eigenvalues?
If ๐ is an eigenvector of ๐ฉ such that ๐ฉ ๐ = ๐ ๐ then how can we evaluate the corresponding eigenvalue ๐? ๐ = ๐๐ผ๐ฉ๐ ๐๐ผ๐ Rayleigh coefficient
Normalized Power Iteration
๐๐ = arbitrary nonzero vector ๐๐ = ๐๐ ๐๐ for ๐ = 1,2, โฆ ๐B = ๐ฉ ๐B<. ๐B =
๐# ๐# ๐& = ๐$ & ๐ฝ$๐$ + ๐ฝ% ๐% ๐$
&
๐% + โฏ + ๐ฝ' ๐' ๐$
&
๐'
Normalized Power Iteration
Demo โPower Iteration
๐B = ๐. B ๐ฝ.๐. + ๐ฝ/ ๐/ ๐.
B
๐/ + โฏ + ๐ฝ; ๐; ๐.
B
๐;
What if the starting vector ๐๐ have no component in the dominant eigenvector ๐$ (๐ฝ$ = 0)?
Normalized Power Iteration
Demo โPower Iteration
๐B = ๐. B ๐ฝ.๐. + ๐ฝ/ ๐/ ๐.
B
๐/ + โฏ + ๐ฝ; ๐; ๐.
B
๐;
What if the first two largest eigenvalues (in magnitude) are the same, |๐$ = |๐% ?
๐B = ๐. B๐ฝ.๐. + ๐. B ๐/ ๐.
B
๐ฝ/๐/ + ๐. B โฆ + ๐ฝ; ๐; ๐.
B
๐;
Potential pitfalls
1. Starting vector ๐๐ may have no component in the dominant eigenvector ๐" (๐ฝ" = 0). This is usually unlikely to happen if ๐๐ is chosen randomly, and in practice not a problem because rounding will usually introduce such component. 2. Risk of eventual overflow (or underflow): in practice the approximated eigenvector is normalized at each iteration (Normalized Power Iteration) 3. First two largest eigenvalues (in magnitude) may be the same: |๐"| = |๐#|. In this case, power iteration will give a vector that is a linear combination of the corresponding eigenvectors:
- If signs are the same, the method will converge to correct magnitude of the
- eigenvalue. If the signs are different, the method will not converge.
- This is a โrealโ problem that cannot be discounted in practice.
Error
๐B = ๐. B ๐ฝ.๐. + ๐ฝ/ ๐/ ๐.
B
๐/ + โฏ + ๐ฝ; ๐; ๐.
B
๐;
๐น๐ ๐ ๐๐
We can see from the above that the rate of convergence depends on the ratio C!
C" , that is:
๐. <B ๐B โ ๐ฝ.๐. = ๐ ๐/ ๐.
B
Convergence and error
๐B = ๐. + ๐ฝ/ ๐ฝ. ๐/ ๐.
B
๐/ + โฏ
๐&
Power method has linear convergence, which is quite slow.
๐PQR ๐P โ ?S ?R
A) 0.1536 B) 0.192 C) 0.09 D) 0.027
Iclicker question
Iclicker question
Suppose we want to use the normalized power iteration, starting from ๐ฆT = (โ0.5,0). Select the correct statement A) Normalized power iteration will not converge B) Normalized power iteration will converge to the eigenvector corresponding to the eigenvalue 2. C) Normalized power iteration will converge to the eigenvector corresponding to the eigenvalue 4.
๐$ ๐%
The matrix ๐ฉ = 3 1 1 3 has eigenvalues (4,2) and corresponding eigenvectors ๐. = (1,1) and ๐/ = (โ1,1).
๐)
Iclicker question
Suppose ๐ is an eigenvector of ๐ฉ such that ๐ฉ ๐ = ๐ ๐ What is an eigenvalue of ๐ฉ<.? A) ๐ B) โ๐ C) 1/๐ D) โ .
C
E) Canโt tell without knowing ๐
Inverse Power Method
Previously we learned that we can use the Power Method to obtain the largest eigenvalue and corresponding eigenvector, by using the update ๐BU. = ๐ฉ ๐B Suppose there is a single smallest eigenvalue of ๐ฉ. With the previous
- rdering
|๐.| > |๐/| โฅ |๐V| โฅ โฏ > |๐;| the smallest eigenvalue is ๐;. When computing the eigenvalues of the inverse matrix ๐ฉ<., we get the following ordering 1 ๐; > 1 ๐;<. โฅ โฏ โฅ 1 ๐. And hence we can use the Power Method update on the matrix ๐ฉ<. to compute the dominant eigenvalue .
C$, i.e.,
๐BU. = ๐ฉ<. ๐B
Iclicker question
Which code snippet is the best option to compute the smallest eigenvalue of the matrix ๐ฉ?
A) B) D) E) I have no idea! C)
Inverse Power Method
Note that the update ๐BU. = ๐ฉ<. ๐B can be instead written as ๐ฉ ๐BU. = ๐B Where ๐B is know and we need to solve for ๐BU. (we are just solving a linear system of equations!). Since the matrix ๐ฉ does not change from iteration to the next, we can factorize the matrix once and then perform a series of backward and forward substitutions. Recall ๐ธ๐ฉ = ๐ด๐ฝ and ๐ฉ ๐ = ๐ resulting in ๐ด๐ฝ ๐ = ๐ธ๐ Hence we can efficiently solve ๐ด ๐ = ๐ธ ๐B ๐ฝ ๐BU. = ๐
Cost of computing eigenvalues using inverse power iteration
Iclicker question
What is the approximated cost of computing the largest eigenvalue using Power Method? A) ๐ ๐ B) ๐/ + ๐ ๐ C) ๐ ๐/ D) ๐V + ๐ ๐/ E) ๐๐๐๐ต
Iclicker question
Suppose ๐ is an eigenvector of ๐ฉ such that ๐ฉ ๐ = ๐๐ ๐ and also ๐ is an eigenvector of ๐ช such that ๐ช ๐ = ๐๐ ๐. What is an eigenvalue of What is an eigenvalue of (๐ฉ + ๐
๐ ๐ช)<.?
A)
C๐ /C๐UC๐
B)
C๐ /C๐UC๐
C)
/ /C๐UC๐
D)
C๐ /C๐UC๐
E)
C๐ /C๐UC๐
Iclicker question
Suppose ๐ is an eigenvector of ๐ฉ such that ๐ฉ ๐ = ๐ ๐ , but ๐ is not the largest or smallest eigenvalue. We want to compute the eigenvalue ๐ that is close to a given number ๐. Which of the following modified matrices will give such eigenvalue? A) A) (๐ฉ โ ๐๐ฑ) B) (๐ฉ โ ๐๐ฑ) <. C) C) (1 โ ๐) ๐ฉ D) .
W ๐ฉ
E) I still have no clue how to answer to these iclicker questionsโฆ
Eigenvalues of a Shifted Inverse Matrix
Suppose the eigenpairs ๐, ๐ satisfy ๐ฉ๐ = ๐ ๐. We can describe the eigenvalues for the shifted inverse matrix as (๐ฉ โ ๐๐ฑ)<.๐ = ฬ ๐ ๐ ๐ฑ๐ = ฬ ๐ ๐๐ฑ โ ๐๐ฑ ๐ ฬ ๐ = 1 ๐ โ ๐ Hence the eigensystem problem is (๐ฉ โ ๐๐ฑ)<.๐ = 1 ๐ โ ๐ ๐
Eigenvalues of a Shifted Inverse Matrix
We use the update ๐ฉ โ ๐๐ฑ ๐BU. = ๐B To obtain the eigenpair ๐, ๐ that satisfy ๐ฉ๐ = ๐ ๐ such that ๐ is an eigenvalue close to the number ๐ We can factorize the matrix ๐ช = ๐ฉ โ ๐๐ฑ such that ๐ธ๐ช = ๐ด๐ฝ and then efficiently solve ๐ด ๐ = ๐ธ ๐B ๐ฝ ๐BU. = ๐
Convergence summary
Method Cost Convergence ๐๐+๐ / ๐๐ Power Method
๐๐+1 = ๐ฉ ๐๐ ๐ ๐' ๐' ๐#
Inverse Power Method
๐ฉ ๐๐+1 = ๐๐ ๐) + ๐ ๐' ๐$ ๐$%#
Shifted Inverse Power Method
(๐ฉ โ ๐๐ฑ)๐๐+1= ๐๐ ๐) + ๐ ๐' ๐/ โ ๐ ๐/' โ ๐
๐$: largest eigenvalue (in magnitude) ๐%: second largest eigenvalue (in magnitude) ๐': smallest eigenvalue (in magnitude) ๐'-$: second smallest eigenvalue (in magnitude) ๐.: closest eigenvalue to ๐ ๐.%: second closest eigenvalue to ๐