[SciPy-user] Reference to algorithm for matrix rank

Matthew Brett matthew.brett@gmail....
Fri Oct 10 15:13:42 CDT 2008


Hi,

> You should get the book _Matrix Computations_ by Golub and van Loan.
> You actually want tol to be relative to S.max(), not an absolute
> tolerance. I like this:
>
>  np.sum(S > (S.max() * np.finfo(M.dtype).eps)

Thanks a lot - I'll have a look.

I saw that matlab does something like this:

eps = np.finfo(S.dtype).eps
tol = max(M.shape)*eps*S[0]

but I didn't know why the max(M.shape)...

Best,

Matthew


More information about the SciPy-user mailing list