Generate random nonnegative matrix with given condition number

181 Views Asked by At

I'm trying to generate random, real, elementwise nonnegative matrices with a given condition number $\kappa$.

Dropping the nonnegativity condition I know that this can be done by generating a random matrix $X$, applying a SVD decomposition $X = U S V^T$, and replacing $S$ with a random diagonal matrix whose maximal and minimal value are $\sigma_1$ and $\sigma_1/\kappa$ respectively. As mentioned however even if the starting matrix is nonnegative, there is no guarantee that the resulting matrix $X' = U S' V^T$ is nonnegative.

I've also tried replacing only the minimal singular value, but this still does not guarantee nonnegativity of the resulting matrix, and may also create trouble if the new minimal singular value becomes $\sigma_n > \sigma_{n-1}$ and so on, as the condition number of the resulting matrix is not the desired one. To avoid this, I tried keeping $\sigma_1$ constant and rescaling all the other singular values, but still some entries of the matrix may become negative.

I've tried googling/searching in m.SE, but found nothing. Is there any known method for accomplishing this task?