How to generate random matrices that are rank-deficient by generating their SVD first?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Duc Anh Le
le 29 Avr 2019
Commenté : Ahmad Khalifi
le 16 Mar 2022
How to generate random matrices that are rank-deficient by generating their SVD first?
1 commentaire
Ahmad Khalifi
le 16 Mar 2022
You can create Rank-one matrix by multiply a column vector with its transpose.
Réponse acceptée
John D'Errico
le 29 Avr 2019
Modifié(e) : John D'Errico
le 30 Avr 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!