|
From: Sven S. <sve...@gm...> - 2006-02-10 11:35:33
|
Fernando Perez schrieb: > Bill Baxter wrote: >> For what it's worth, matlab's rank function just calls svd, and >> returns the >> number singular values greater than a tolerance. The implementation is a >> whopping 5 lines long. > > Yup, and it would be pretty much the same 5 lines in numpy, with the > same semantics. > > Here's a quick and dirty implementation for old-scipy (I don't have > new-scipy on this box): > Is there any reason not to use the algorithm implicit in lstsq, as in: rk = linalg.lstsq(M, ones(p))[2] (where M is the matrix to check, and p==M.shape[0]) thanks, sven |