Suppose has a dominant eigenvalue , that’s, , . Then . The dominant eigenvalue could be computed by the ability methodology.
On this pseudocode, norm(x)
denotes the -norm of x
.
Select n-vector q_0 such that norm(q_0) = 1. for okay=1,2,... z_k = A q_{k-1} % Apply A. q_k = z_k / norm(z_k) % Normalize. mu_k = q_k^*Aq_k % Rayleigh quotient. finish
The normalization is to keep away from overflow and underflow and the are approximations to .
If has a nontrivial part within the path of the eigenvector akin to the dominant eigenvalue then the ability methodology converges linearly, with a relentless that relies on the ratio of the spectral radius to the magnitude of the subsequent largest eigenvalue in magnitude.
Right here is an instance the place the ability methodology converges rapidly, because of the substantial ratio of between the spectral radius and subsequent largest eigenvalue in magnitude.
>> rng(1); A = rand(4); eig_abs = abs(eig(A)), q = rand(4,1); >> for okay = 1:5, q = A*q; q = q/norm(q); mu = q'*A*q; >> fprintf('%1.0f %7.4en',okay,mu) >> finish eig_abs = 1.3567e+00 2.0898e-01 2.5642e-01 1.9492e-01 1 1.4068e+00 2 1.3559e+00 3 1.3580e+00 4 1.3567e+00 5 1.3567e+00