From: Muhammad on
"Steven Lord" <slord(a)mathworks.com> wrote in message <eom61k$n0p$1(a)fred.mathworks.com>...
>
> "Prone" <""prone\"@niechce spamu.kurde.pl"> wrote in message
> news:10a2$45ae9317$540a21ec$21842(a)news.chello.pl...
> > hello,
> > we have a matrix, which looks like that:
> >
> > Mac =
> >
> > 1.0000e+000 -3.4274e+003 3.8302e+006 10.3310e+009
> > 0.0000e-003 1.0000e+000 -3.4274e+003 3.8302e+006
> > 0.0000e-003 0.0000e-003 1.0000e+000 -3.4274e+003
> > 0.0000e-003 0.0000e-003 0.0000e-003 1.0000e+000
> >
> > rank(Mac) gives: 3.
> >
> > why? It's obvious rank of that maxtrix is 4 beacuse it has linearly
> > independent rows or columns, all of them.
>
> RANK uses the singular values from SVD and a tolerance based the the
> magnitudes of the singular values to determine the rank of the matrix; the
> rank is the number of singular values greater than the tolerance. For this
> matrix, there are two small singular values (on the order of 1e-5 and
> 1e-10), one moderate (about 5000) and one really large singular value (about
> 1e10). The tolerance is based on eps of the largest singular value, which
> in this case is about 1e-6. The smallest singular value is less than the
> tolerance, so the rank calculation returns 3.
>
> You say that the rank of the matrix is obviously 4 ... but dividing through
> by a nonzero scalar shouldn't change the rank, so would you also call this a
> rank 4 matrix?
>
> 1e-009 -3.4274e-006 0.0038302
> 10.331
> 0
> 1e-009 -3.4274e-006 0.0038302
> 0 0
> 1e-009 -3.4274e-006
> 0 0
> 0 1e-009
>
> The first column or last row (take your pick) are looking pretty negligible.
> In the original matrix, compared to the element in the upper-right corner,
> the 1's in the upper-left and lower-right corners were relatively
> negligible. If you have a billion dollars, does one more really matter that
> much?
>
> By the way, you can specify a tolerance in the RANK function -- specifying a
> tolerance less than 2e-10 causes it to return 4.
>
> --
> Steve Lord
> slord(a)mathworks.com
>
>
Hi, I'm also facing the same problem. Can you explain to me what is the criteria to choose the tolerance, why the tolerance is set to be
tol = max(size(A))*eps(max(s));
..??
Can I select arbitrary low value as tolerance.?
Thank you.
Best Regards
From: John D'Errico on
"Muhammad " <paut_ft3(a)yahoo.com> wrote in message <hqulri$rqf$1(a)fred.mathworks.com>...

> Hi, I'm also facing the same problem. Can you explain to me what is the criteria to choose the tolerance, why the tolerance is set to be
> tol = max(size(A))*eps(max(s));
> .??
> Can I select arbitrary low value as tolerance.?

You can do anything that you want. It is after all,
your code that you will write. However, your choice
may simply result in misleading yourself.

Setting the tolerance at some arbitrary value is the
moral equivalent of pretending that the matrix is
not really singular. Does this pretend play mean it
is not in fact singular? Why use rank at all then, if
you will effectively not believe the prediction?

The choice of the tolerance is made to identify those
matrices which are clearly non-singular from those
that cross the line of numerical singularity. So if you
were to increase that tolerance by a factor of 10, to
be thus slightly less conservative, this might not be
a bad thing. But to set the tolerance at some arbitrarily
large number is just silly.

John