'Cut of in SVD method

I want to invert a matrix using the singular value decomposition (SVD) I used first

u, s, vh = np.linalg.svd(R, full_matrices=False)

Then i calculated the inverse of each parameter

   u_1 = np.transpose(u)
   s_1 = np.transpose(s)
   vh_1 = np.transpose(vh)

And i multiplied these values

b=1./s
sig =  np.diag(b)
Rv = np.transpose(vh) @ sig @ np.transpose(u)

The problem arises an error, and when i checked the condition number of R it was very larg value, So i was thinking about cutting of the singular vale matrix b. My quistion is how can i cose where is cut off ? I plotted the log of the singular values s and here is the plot

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source