[SciPy-user] linalg.lstsq

Nils Wagner nwagner@iam.uni-stuttgart...
Wed Oct 15 12:52:20 CDT 2008


Hi all,

I have a question concerning linalg.lstsq.

AFAIK, the residues of linalg.lstsq should be real in case 
of complex matrices.
Am I missing something ?


from scipy.linalg import lstsq
from scipy import rand
m = 9
n = 5
A = rand(m,n)+1j*rand(m,n)
b = rand(m)
x,residues,rank,s = lstsq(A,b)
print 'residues',residues # should be real

m = 9
n = 9
A = rand(m,n)+1j*rand(m,n)
b = rand(m)
x,residues,rank,s = lstsq(A,b)
print 'residues',residues # should be real order of 
machine precision


Nils


More information about the SciPy-user mailing list