https://pythonnumericalmethods.berkeley.edu/notebooks/chapter15.02-The-Power-Method.html
The Power Method¶
Find the largest eigenvalue¶
In some problems, we only need to find the largest dominant eigenvalue and its corresponding eigenvector. In this case, we can use the power method - a iterative method that will converge to the largest eigenvalue. Let’s see the following how the power method works.
Consider an matrix that has linearly independent real eigenvalues and the corresponding eigenvectors . Since the eigenvalues are scalars, we can rank them so that (actually, we only require , other eigenvalues may be equal to each other).
Because the eigenvectors are independent, they are a set of basis vectors, which means that any vector that is in the same space can be written as a linear combination of the basis vectors. That is, for any vector , it can be written as:
where is the constraint. If it is zero, then we need to choose another initial vector so that .
Now let’s multiply both sides by :
Since , we will have:
We can change the above equation to:
where is a new vector and .
This finishes the first iteration. And we can multiply to to start the 2nd iteration:
Similarly, we can rearrange the above equation to:
where is another new vector and .
We can continue multiply with the new vector we get from each iteration times:
Because is the largest eigenvalue, therefore, the ratio for all . Thus when we increase to sufficient large, the ratio of will be close to 0. So that all the terms that contain this ratio can be neglected as grows:
Essentially, as is large enough, we will get the largest eigenvalue and its corresponding eigenvector. When implementing this power method, we usually normalize the resulting vector in each iteration. This can be done by factoring out the largest element in the vector, which will make the largest element in the vector equal to 1. This normalization will get us the largest eigenvalue and its corresponding eigenvector at the same time. Let’s take a look of the following example.
You may ask when should we stop the iteration? The basic stopping criteria should be one of the three: in the consecutive iterations, (1) the difference between eigenvalues is less than some specified tolerance; (2) the angle between eigenvectors is smaller than a threshold ; or the norm of the residual vector is small enough.
TRY IT! We know from last section that the largest eigenvalue is 4 for matrix , now use the power method to find the largest eigenvalue and the associated eigenvector. You can use the initial vector [1, 1] to start the iteration.
1st iteration: $$
=\begin{bmatrix} 2\5\ \end{bmatrix} =5\begin{bmatrix} 0.4\1\ \end{bmatrix} $$
2nd iteration: $$
=\begin{bmatrix} 2\3.8\ \end{bmatrix} =3.8\begin{bmatrix} 0.5263\1\ \end{bmatrix} $$
3rd iteration: $$
=\begin{bmatrix} 2\ 4.0526\ \end{bmatrix} = 4.0526\begin{bmatrix} 0.4935\1\ \end{bmatrix} $$
4th iteration: $$
=\begin{bmatrix} 2\ 3.987\ \end{bmatrix} = 3.987\begin{bmatrix} 0.5016\1\ \end{bmatrix} $$
5th iteration: $$
=\begin{bmatrix} 2\ 4.0032\ \end{bmatrix} = 4.0032\begin{bmatrix} 0.4996\1\ \end{bmatrix} $$
6th iteration: $$
=\begin{bmatrix} 2\ 3.9992\ \end{bmatrix} = 3.9992\begin{bmatrix} 0.5001\1\ \end{bmatrix} $$
7th iteration: $$
=\begin{bmatrix} 2\ 4.0002\ \end{bmatrix} = 4.0002\begin{bmatrix} 0.5000\1\ \end{bmatrix} $$
We can see after 7 iterations, the eigenvalue converged to 4 with [0.5, 1] as the corresponding eigenvector.
TRY IT! Implement the power method in Python
The inverse power method¶
The eigenvalues of the inverse matrix are the reciprocals of the eigenvalues of . We can take advantage of this feature as well as the power method to get the smallest eigenvalue of , this will be basis of the inverse power method. The steps are very simple, instead of multiplying as described above, we just multiply for our iteration to find the largest value of , which will be the smallest value of the eigenvalues for . As for the inverse of the matrix, in practice, we can use the methods we covered in the previous chapter to calculate it. We won’t got to the details here, but let’s see an example.
TRY IT! Find the smallest eigenvalue and eigenvector for .
The shifted power method¶
In some cases, we need to find all the eigenvalues and eigenvectors instead of the largest and smallest. One simple but inefficient way is to use the shifted power method (we will introduce you an efficient way in next section). Given , and is the largest eigenvalue obtained by the power method, then we can have:
where ’s are the eigenvalues of the shifted matrix , which will be .
Now if we apply the power method to the shifted matrix, then we can determine the largest eigenvalue of the shifted matrix, i.e. . Since , we can get the eigenvalue easily. We can repeat this process many times to find the all the other eigenvalues. But you can see that, it involves a lot of work! A better method for finding all the eigenvalues is to use the QR method, let’s see the next section how it works!
< 15.1 Mathematical Characteristics of Eigen-problems | Contents | 15.3 The QR Method >
No hay comentarios:
Publicar un comentario