> the following piece of code is a simple test case of my actual code
>
> [m, n] = size(A); % in my case m > n
> if rank(A) == n
> x = A\b; % b is known vector of appropriate dimension
> else
> disp('rank deficient!!!')
> end
>
> i.e. solve the system of equations ONLY when A is full column rank.
>
> i discovered that even when rank() reports a full column rank the backslash operator warns of A being rank deficient!!! on investigating further i gathered that rank() uses svd() to determine the rank while \ uses qr() to solve the over-determined system of equations.
>
> the rank() method uses a tolerance of
>
> tolsvd = max(size(A)) * eps(max(s));
>
> as specified in the corresponding m-file. however there is NO mention of the tolerance used by mldivide or the backslash operator even though it prints a warning when this tolerance level is violated.
>
> i found this link .
http://amath.colorado.edu/computing/Matlab/OldTechDocs/ref/qr.html which seems to indicate the tolerance used by \ operator is
>
> tol_mldivide_qr = max(size(A))*eps*abs(R(1,1))
>
> is that right?
>
> could somebody point me to some explanations as to the choice of these bounds? are these standard and published somewhere?
>
> although the two tolerances mentioned above apply to two different objects the rank conclusions about A should be consistent when used on the same computer with same class of variables (double in my case).
>
How can a method that does not call svd be ABSOLUTELY
consistent with a method that does call svd?
> also is it possible to pass user specified tolerance to the backslash operator?
>
No.
> in your informed opinion what should be done? should i trust svd() over mldivide() ?
If you are that close to the edge, you should be fearful.
Your results will be highly suspect, and will be terribly
dependent on tiny errors in the least significant bits of
your data.
Yes, trust the signal that rank returns slightly more.
But if backslash is having a problem, that means you
are still at risk of having numerical garbage as a result.
You should consider if something can be improved.
For example, if this is a polynomial model (perhaps the
single largest source of ill-conditioned linear systems)
then you are using too high order polynomials. You
might also consider using centering and scaling of
the problem, but even then, you may still be using
too high an order. If this is from some other scheme,
then you are still treading on thin ice, and should look
for ways to improve the conditioning of your problem.
Just because one method does not flag this system as
ill-posed does not mean it is automatically well-posed!
John