MATLAB Function Reference |
奇異值分解(Singular value decomposition)
Syntax
s = svd(X) [U,S,V] = svd(X) [U,S,V] = svd(X,0)
Description
[U,S,V] = svd(X)
會產生一個與 X
維度相同的對角矩陣 S
(非負的對角線元素會以遞減順序排列),和兩個么正矩陣 U
、V
使得 X
=
U*S*V'。
[U,S,V] = svd(X,0)
會產生 "economy size" 的分解。若 X
是一個 m
-by-n
矩陣且 m
> n
, 則 svd
只會算 U
的前 n
行且 S
為 n
-by-n
矩陣。
Examples
X = 1 2 3 4 5 6 7 8
[U,S,V]
=
svd(X)
U = -0.1525 -0.8226 -0.3945 -0.3800 -0.3499 -0.4214 0.2428 0.8007 -0.5474 -0.0201 0.6979 -0.4614 -0.7448 0.3812 -0.5462 0.0407 S = 14.2691 0 0 0.6268 0 0 0 0 V = -0.6414 0.7672 -0.7672 -0.6414
[U,S,V]
=
svd(X,0)
U = -0.1525 -0.8226 -0.3499 -0.4214 -0.5474 -0.0201 -0.7448 0.3812 S = 14.2691 0 0 0.6268 V = -0.6414 0.7672 -0.7672 -0.6414
Algorithm
svd
是用 LAPACK routines 來計算矩陣的 Singular value decomposition 。
Matrix |
Routine |
Real |
DGESVD |
Complex |
ZGESVD |
Diagnostics
求奇異值時,要是限制最多的 QR step iterations 為75,會出現以下訊息:
Solution will not converge.
References
[1] Anderson, E., Z. Bai, C. Bischof, S. Blackford, J. Demmel, J. Dongarra, J. Du Croz, A. Greenbaum, S. Hammarling, A. McKenney, and D. Sorensen, LAPACK User's Guide (http://www.netlib.org/lapack/lug/ lapack_lug.html), Third Edition, SIAM, Philadelphia, 1999.
surfnorm | svds |