Generate a random matrix with a specific rank and power

I would like to create a rectangular matrix A, with elements in a closed interval [0,1], which satisfies the following properties:

(1) size(A) = (200,2000)
(2) rank(A) = 50
(3) nnz(A) = 100000

Best of all, if nonzero elements in Awill decay exponentially, or at least polynomially (I want significantly smaller values ​​than large ones). Obviously (I think ...), normalization to [0,1], after all, is not the main problem here.

Things I tried that didn't work:

  • First we generate a random matrix with A=abs(randn(200,2000))and a threshold

    th = prctile(A(:),(1-(100000/(200*2000)))*100);
    A = A.*(A>th);
    

    Now that the property is (3)complete, I lowered the rank

    [U,S,V] = svd(A);
    for i=51:200 S(i,i)=0; end
    A = U*S/V;
    

    But this matrix has almost full power (I lost the property (3)).

  • A=rand(200,50)*rand(50,2000). , (2), , . (2), .

... , (2) (3)?

P.S. , - / ( 50 ...).

+4
2

:

A = zeros(200,2000);
A(:,1:500) = repmat(rand(200,50),1,10);

:

A = A(:,randperm(size(A,2)));

: 500 , 1500 . ( , ).

0

:

>> A= rand(200,50);
>> B= zeros(200,1950);
>> A = [A B];
>> A = A(:,randperm(size(A,2)));
>> rank(A)

ans =

    50

>> nnz(A)

ans =

       10000
0

All Articles