计算最主要 eigenvalue/singular 值的最快方法是什么?
What is the fastest way to calculate most dominant eigenvalue/singular value?
我只知道下面的幂迭代。但是当行和列都非常大时,它需要创建一个巨大的矩阵 A'*A 。 A 也是稠密矩阵。下面的幂迭代方法有什么替代方法吗?听说过krylov子空间法,但不熟悉。无论如何,我正在寻找比下面提到的方法更快的方法:
B = A'*A; % or B = A*A' if it is smaller
x = B(:,1); % example of starting point, x will have the largest eigenvector
x = x/norm(x);
for i = 1:200
y = B*x;
y = y/norm(y);
% norm(x - y); % <- residual, you can try to use it to stop iteration
x = y;
end;
n3 = sqrt(mean(B*x./x)) % translate eigenvalue of B to singular value of A
我用 100*100 随机生成的矩阵检查了 matlab 的 'svd' 命令。它比您的代码快近 5 倍。
s = svd(A);
n3 = s(1);
我只知道下面的幂迭代。但是当行和列都非常大时,它需要创建一个巨大的矩阵 A'*A 。 A 也是稠密矩阵。下面的幂迭代方法有什么替代方法吗?听说过krylov子空间法,但不熟悉。无论如何,我正在寻找比下面提到的方法更快的方法:
B = A'*A; % or B = A*A' if it is smaller
x = B(:,1); % example of starting point, x will have the largest eigenvector
x = x/norm(x);
for i = 1:200
y = B*x;
y = y/norm(y);
% norm(x - y); % <- residual, you can try to use it to stop iteration
x = y;
end;
n3 = sqrt(mean(B*x./x)) % translate eigenvalue of B to singular value of A
我用 100*100 随机生成的矩阵检查了 matlab 的 'svd' 命令。它比您的代码快近 5 倍。
s = svd(A);
n3 = s(1);