How to generate random matrices that are rank-deficient by generating their SVD first?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Duc Anh Le
am 29 Apr. 2019
Kommentiert: Ahmad Khalifi
am 16 Mär. 2022
How to generate random matrices that are rank-deficient by generating their SVD first?
1 Kommentar
Ahmad Khalifi
am 16 Mär. 2022
You can create Rank-one matrix by multiply a column vector with its transpose.
Akzeptierte Antwort
John D'Errico
am 29 Apr. 2019
Bearbeitet: John D'Errico
am 30 Apr. 2019
You do it by understanding what a rank deficient matrix is, and what the svd means. The svd of a matrix is a decomposition of the form:
A = U*S*V'
Here U and V are arbitrary ("random") orthogonal matrices, and S is diagonal, containing the singular values. U,S, and V need to be the correct size.
So, to pick a set of singular values. As long as at least one of them is zero, that is all you need. This is true because a diagonal matrix with at least one zero will always be singular. And the product of any pair of matrices cannot have higher rank than either of the members of that product.
The problem is, only you know what "random" means to you. The idea of generating a "random" number, without specifying the distribution of that number is something that has no meaning. So you need to choose those things that will be called random.
You can easily generate an arbitrary orthogonal matrix of size nxn as
Q = orth(randn(n,n));
Of course, that this call to orth actually uses the svd itself seems a bit incestuous. But you could also just use a QR, and avoid the svd.
[Q,R] = qr(randn(n,n));
Pick the singular values as a vector. Remember, one of them must be zero. Create the matrix S using diag. Then form the product as I show above.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!