Determining the condition number of matrix
![](https://secure.gravatar.com/avatar/f9a51133faceafc4a7935ce9bedb5831.jpg?s=120&d=mm&r=g)
Hi Does numeric have a facility to estimate the condition number of a matrix? Thanks Neilen -- you know its kind of tragic we live in the new world but we've lost the magic -- Battery 9 (www.battery9.co.za)
![](https://secure.gravatar.com/avatar/652de683df845c20ee1bf88a299e80c9.jpg?s=120&d=mm&r=g)
Neilen Marais wrote:
The only way I can think of is through SVD: import RandomArray as RA import LinearAlgebra as LA n = 100 a = RA.random((n, n)) vt, s, u = LA.singular_value_decomposition(a) cond2 = s[0] / s[-1] print cond2 The above code computes 2-norm condition number. Since Numeric has only limited binding to LAPACK you should probably look into SciPy that might have bindings to LAPACK's condition number estimators. Piotr
![](https://secure.gravatar.com/avatar/652de683df845c20ee1bf88a299e80c9.jpg?s=120&d=mm&r=g)
Neilen Marais wrote:
The only way I can think of is through SVD: import RandomArray as RA import LinearAlgebra as LA n = 100 a = RA.random((n, n)) vt, s, u = LA.singular_value_decomposition(a) cond2 = s[0] / s[-1] print cond2 The above code computes 2-norm condition number. Since Numeric has only limited binding to LAPACK you should probably look into SciPy that might have bindings to LAPACK's condition number estimators. Piotr
participants (2)
-
Neilen Marais
-
Piotr Luszczek