How to generate a N*D random matrix with columns of unit length?

485 Views Asked by At

Is it possible to generate a N*D random matrix with columns of unit length?

If not, I also think it is possible of generating a N*D random matrix and, after that, normalizing it in order to have columns of unit length.

Is this last case, how is this possible mathematically?

1

There are 1 best solutions below

8
On BEST ANSWER

If you want the column vectors to be uniformly distributed on the unit sphere, you may first generate an $N\times D$ rectangular array of standard normal pseudorandom numbers, and then normalise the length of each column vector.