COND for homogeneous equations?
Afficher commentaires plus anciens
Normally, when we want to compute error tendency in the solution of a system of heterogeneous linear equations,
A*x=b
we compute the condition number cond(A) or rcond(A). I am curious to know if there is an analogous way to assess homogeneous equations,
A*x=0
In computer vision, it is common for a desired solution to be the unique (ideally) null vector of such a system. But how do we measure how robustly one-dimensional (or more) the null space of a matrix is? It's occurred to me that you could do it by looking at the ratio between the smallest two singular values,
S=svd(A);
metric = S(end-1)/S(end);
but I was curious if there was a more established metric, and a corresponding MATLAB builtin that computes it.
EDIT: And additionally, how would we relate this metric to accuracy of the solution? If A is rank n-1, can we put bounds on the error in computing the null space basis vector, x? And what about rank n-m, m>1?
1 commentaire
John D'Errico
le 21 Oct 2017
I think you should write a tool for this purpose. Call it something like singularityReport perhaps. It could generate various measures about the matrix, terribly useful for someone who does not really understand the SVD.
How close is the matrix to singularity?
If singular, what is the dimension of the null space, and what further perturbation of the matrix would be required to increase the dimension of the null space?
If not singular, how will solving a linear system using this matrix amplify any noise in the problem?
You could make it so the tool returns a set of measures in a struct, but provide a verbosity parameter to allow the tool to explain those measures in more detail. This would make it a useful tool to someone fairly new to numerical linear algebra who wants to solve a linear system.
Réponse acceptée
Plus de réponses (2)
Christine Tobler
le 18 Oct 2017
That's an interesting question, I'm not sure what the right way to do this is. In a first step, the matrix condition number describes how much an error in the right-hand side b can be amplified in the solution vector x. So if there is mathematically exact x_exact and b_exact with A*x_exact = b_exact, then the best numerical solution x will satisfy
|| A*x - b_exact|| / ||b_exact|| <= cond(A) * ||x - x_exact|| / ||x_exact||.
When b is always zero, this relative error bound does not make sense. Also, in this bound we are assuming that A can be represented exactly, which may not make sense for the homogeneous equation. So strictly speaking, the first step would be to figure out what kind of error in the solution x we want to estimate.
That said, I think the ratio of the last and second-to-last singular value you propose is an intuitive measure that should work great. I'd just propose to use them the other way round, S(end) / S(end-1), so that a matrix with exactly rank n-1 will show a value of zero.
1 commentaire
Christine Tobler
le 19 Oct 2017
Modifié(e) : Christine Tobler
le 19 Oct 2017
I think John is right that there need to be two measures to check here, and that we should look at more of the singular values. I would just describe the two conditions a bit differently:
- Does a solution to A*x = 0 exist? (that is, is the matrix singular?)-> we can measure this using cond(A), i.e., s(end)/s(1). This answers "How small a (relative) perturbation of A could make it exactly singular?"
- Is the solution to A*x = 0 unique? Here's where the second smallest singular value comes in, which we could measure in two ways:
a) s(end-1)/s(1): "How small a (relative) perturbation of A would cause it to be rank n-2?"
b) s(end-1)/s(end): "If the solution x = V(:,end) gives us norm(A*x), how much smaller will norm(A*x2) be using x2 = V(:, end-1)?"
For square matrices, existence and uniqueness of the solution are coupled, so there it's enough to look at the condition number alone.
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!