tol in rank function

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

tol in rank function

José Luis García Pallero
Hello:

I can see in the help of rank() function that the tolerance to
consider a singular value is

tol = max (size (A)) * sigma(1) * eps;

Can anyone pleage give me a bibliographic source for this expression?

Thanks

--
*****************************************
José Luis García Pallero
[hidden email]
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************

Reply | Threaded
Open this post in threaded view
|

Re: tol in rank function

siko1056
Hi,

Octave's [simplified rank function][1] is

s = svd (A);
tol = max (size (A)) * s(1) * eps;
r = sum (s > tol);

and [Matlab's][2]

s = svd(A);
tol = max (size(A)) * eps (max(s));  % effectively only "max (size(A)) * eps ('double')"
r = sum(s > tol);

So maybe Octave should revisit the default tolerance for matlab compatibiliy. References I found go to the [SVD error bound estimation of LAPACK][3] and [here][4] comes close to the Octave implementation using the largest singular value.

Two other comprehensive sources for matrix computation I would look at are [Golub & Van Loan 1996][5] or [Higham 2002][6].

Kai

[1]: http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/linear-algebra/rank.m
[2]: https://www.mathworks.com/help/matlab/ref/rank.html
[3]: http://www.netlib.org/lapack/lug/node96.html
[4]: http://www.netlib.org/lapack/lug/node97.html
[5]: http://web.mit.edu/ehliu/Public/sclark/Golub%20G.H.,%20Van%20Loan%20C.F.-%20Matrix%20Computations.pdf
[6]: http://servidor.demec.ufpr.br/CFD/bibliografia/Higham_2002_Accuracy%20and%20Stability%20of%20Numerical%20Algorithms.pdf
Reply | Threaded
Open this post in threaded view
|

Re: tol in rank function

José Luis García Pallero
2016-10-22 13:09 GMT+02:00 siko1056 <[hidden email]>:

> Hi,
>
> Octave's [simplified rank function][1] is
>
> s = svd (A);
> tol = max (size (A)) * s(1) * eps;
> r = sum (s > tol);
>
> and [Matlab's][2]
>
> s = svd(A);
> tol = max (size(A)) * eps (max(s));  % effectively only "max (size(A)) * eps
> ('double')"
> r = sum(s > tol);
>
> So maybe Octave should revisit the default tolerance for matlab
> compatibiliy. References I found go to the [SVD error bound estimation of
> LAPACK][3] and [here][4] comes close to the Octave implementation using the
> largest singular value.
>
> Two other comprehensive sources for matrix computation I would look at are
> [Golub & Van Loan 1996][5] or [Higham 2002][6].

Thank you very much for your answer



--
*****************************************
José Luis García Pallero
[hidden email]
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************