Generate singular values of a matrix(Gaussian Random) using Quadrant law in python.

121 Views Asked by At

I need to generate Gaussian Random Matrices for a given rank and condition number in python.

For a given target condition number K=5, I select the largest singular value sigma_max uniformly at random in the interval [1, 500]. This sets the smallest singular value as sigma_min = sigma_max/K.

The remaining singular values need to be generated from the Quadrant law. Attached is the link to the paper for the reference( theorem 2) On the singular values of Gaussian random matrices by Jianhong Shen.

I can use SVD and QR decomposition to generate the final matrix.

Here is the code I'm working on in python.

rank=5
condn_num = 5(condition number)
sigma_max = np.random.uniform(1,500)
sigma_min = sigma_max / condn_num

U_ = np.random.normal(0, 1, (rows, rank))
q, r = np.linalg.qr(U_)
U = q
V_ = np.random.normal(0, 1, (cols, rank))
q, r = np.linalg.qr(V_)
V = q
final_matrix = U @ s @ V.transpose() 
//s is a diagonal matrix of dimension(rank X rank)

I need to populate the diagonal matrix s with the remaining singular values from the Quadrant law mentioned in the paper above. Do anybody how this quadrant law is used to generate remaining singular values?