I have a matrix that is extremely singular, but I am still interested in computing the exact condition number, which is the ratio between the largest and smallest singular values.

Is it possible to do it in Python? I am curious because if we stick with machine precision 10^-16, then any condition number beyond 10^16 could be inaccurate.

  • $\begingroup$ Can you please give a sample input? It's difficult to discern the exact condition. $\endgroup$
    – kokeen
    Dec 14, 2018 at 4:17
  • 4
    $\begingroup$ The usual way to compute the condition number is via the SVD. The computed singular values will almost certainly be somewhat inaccurate. How much precision do you really need? If the true condition number was say 10^17+1 but it was computed asd 10^17 would that really matter to you? $\endgroup$
    – dmuir
    Dec 15, 2018 at 14:54
  • 1
    $\begingroup$ Is this an matrix of integers? $\endgroup$
    – James K Polk
    Dec 18, 2018 at 20:10
  • 2
    $\begingroup$ You seem to understand that you'll need to compute the singular values of your matrix in a higher precision than standard double precision. The "what library does extended precision singular value computations" question isn't really suitable for Computational Science stackexchange. However, you might look at the mpmath library to see if it does what you need. $\endgroup$ Jan 20, 2019 at 17:19


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.