1.The Power Method
寻找最大特征值。
不断按照x=Au迭代,
u是上一次的x归一化的结果。
当前的特征值为x坐标中绝对值的最大的
Algorithm: Power Method
To approximate the dominant eigenvalue and an associated eigenvector of the n*n matrix A given a nonzero initial vector.
Input: dimension n; matrix a[ ][ ]; initial vector x0[ ]; tolerance TOL; maximum number of iterations Nmax.
Output: approximate eigenvalue lambda and approximate eigenvector (normalized) or a message of failure.
Step 1 Set k = 1;
Step 2 Find index such that | x0[ index ] | = || x0 ||infty ;
Step 3 Set x0[ ] = x0[ ] / x0[ index ]; /* normalize x0 */
Step 4 While ( k <= Nmax) do steps 5-11
Step 5 x[ ] = A x0[ ]; /* compute xk from u^{k-1} */
Step 6 lambda = x[ index ];
Step 7 Find index such that | x[ index ] | = || x ||infty ;
Step 8 If x[ index ] == 0 then
Output ( “A has the eigenvalue 0”; x0[ ] ) ; STOP.
/* the matrix is singular and user should try a new x0 */
Step 9 err = || x0 - x / x[ index ] || infty ;
x0[ ] = x[ ] / x[ index ]; /* compute uk */
Step 10 If (err < TOL) then
Output ( lambda ; x0[ ] ) ; STOP. /* successful */
Step 11 Set k ++;
Step 12 Output (Maximum number of iterations exceeded);
STOP. /* unsuccessful */
最大特征值相同也可以算
如果lambda1 = -lambda2 则不能算
收敛速度:
两次迭代的特征值之比越小越好,因此用幂法算B=A-pI的特征值,p=(lambda1+lambda2)/2
最后算出的特征值加上p
2.Inverse Power Method
反幂法,计算最小的特征值,
计算p附近的特征值:
1.令B=A-pI
2.使用幂法,但是使用迭代(每次需要解xk=Axk+1)
3.幂法计算得到的特征值为:1/(lamda-p),然后解出lambda