MATLAB Answers

How does `svd(A*A')` reduce the computational cost?

4 ビュー (過去 30 日間)
鹏程 张
鹏程 张 2021 年 6 月 21 日
コメント済み: 鹏程 张 2021 年 6 月 21 日
Computing singular value decomposition is the main computational cost in many algorithms .
For a matrixA(m*n) ,if m is much larger than n , one can compute the SVD of A*A',and then get an approximate SVD of by simple operations to reduce the computational cost.
How does it reduce the computational cost?
  2 件のコメント
鹏程 张
鹏程 张 2021 年 6 月 21 日
Thank you for your answer!
I want to know facing a unbalanced matrix, such as 3*5000, why someone reduce the computational cost by svd(A*A') .
The code is as follows.
function [S, V, D, Sigma2] = MySVD(A)
[m, n] = size(A);
if 2*m < n
AAT = A*A';
[S, Sigma2, D] = svd(AAT);
Sigma2 = diag(Sigma2);
V = sqrt(Sigma2);
tol = max(size(A)) * eps(max(V));
R = sum(V > tol);
V = V(1:R);
S = S(:,1:R);
D = A'*S*diag(1./V);
V = diag(V);
return;
end
if m > 2*n
[S, V, D, Sigma2] = MySVD(A');
mid = D;
D = S;
S = mid;
return;
end
[S,V,D] = svd(A);
Sigma2 = diag(V).^2;

サインインしてコメントする。

回答 (1 件)

Cutie
Cutie 2021 年 6 月 21 日
SVD reduces computational costs because it provides a numerically stable matrix decomposition. You may refer to https://www.youtube.com/playlist?list=PLMrJAkhIeNNSVjnsviglFoY2nXildDCcv for detailed wokrings of SVD
  1 件のコメント
鹏程 张
鹏程 张 2021 年 6 月 21 日
Thank you for your answer! Maybe I don't express what I want to know!
what I want to know is when facing a unbalanced matrix, such as 3*5000, why someone reduce the computational cost by svd(A*A') .
The code is as follows.
function [S, V, D, Sigma2] = MySVD(A)
[m, n] = size(A);
if 2*m < n
AAT = A*A';
[S, Sigma2, D] = svd(AAT);
Sigma2 = diag(Sigma2);
V = sqrt(Sigma2);
tol = max(size(A)) * eps(max(V));
R = sum(V > tol);
V = V(1:R);
S = S(:,1:R);
D = A'*S*diag(1./V);
V = diag(V);
return;
end
if m > 2*n
[S, V, D, Sigma2] = MySVD(A');
mid = D;
D = S;
S = mid;
return;
end
[S,V,D] = svd(A);
Sigma2 = diag(V).^2;

サインインしてコメントする。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by