How to generate a Rank r matrix with entries Uniform?

575 Views Asked by At

I want to generate a $200 \times 200$ matrix of low rank (say 5) with entries Uniformly distributed in [0,1]. What should be the right algorithm for this?

1

There are 1 best solutions below

0
On

I assume that you want entries to be "very random", since you already have considered using random linear span of random vectors and decided that it is not 'random' enough. I write this since if you want this some practical reasons, I think that the solution above - using random vectors and linear span - will be somewhat nice, and much more efficient than solution I suggest.

The key is in singular value decomposition. Each eigenvalue is real and has single multiplicity, but you can slightly modify this if you need.

1) First, you generate a matrix $P$ of desired size, which must be orthogonal. For this, you can take various approach. http://home.lu.lv/~sd20008/papers/essays/Random%20unitary%20%5Bpaper%5D.pdf is a good reference, if you want to study this more. This pdf is for unitary matrices, and it suggests choosing random points from a sphere to assure uniform distribution.

2) pick $r$ random real numbers, which will be eigenvalue of your matrix. $D = diag(\lambda_1, \lambda_2, \dots, \lambda_r, 0, \dots, 0)$.

3) Then, of course, use $A = PDP^{*}$.

This way, you can generate a matrix with given rank with uniform entries.