How to generate random matrices that are rank-deficient by generating their SVD first?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Duc Anh Le
il 29 Apr 2019
Commentato: Ahmad Khalifi
il 16 Mar 2022
How to generate random matrices that are rank-deficient by generating their SVD first?
1 Commento
Ahmad Khalifi
il 16 Mar 2022
You can create Rank-one matrix by multiply a column vector with its transpose.
Risposta accettata
John D'Errico
il 29 Apr 2019
Modificato: John D'Errico
il 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!