finding partial solutions from ill-conditioned equations
18 views (last 30 days)
Show older comments
I am hoping you can point me in the right direction. I have a linear system Ax = b. A is illconditioned. I believe, however that the equation can be used to compute an accurate estimate for some elements of x but probably not all. What algorithm can be used to compute the largest subset of x accurately?
For example, A is 10 by 10 but do to its structure only allows accurate calculation of x_1 and x_2. How to find x_1 and x_2?
Thank you in advance. Greg
0 Comments
Accepted Answer
Matt J
on 18 Mar 2025
If you know which x(i) are well-determined, you could use lsqminnorm. In this example, we know that only x(1:2) are well-determined, so we can do,
A=rand(10).*[1,1,zeros(1,8)]
b=3*A(:,1)+2*A(:,2);
x=lsqminnorm(A,b); x=x(1:2)
1 Comment
Matt J
on 19 Mar 2025
Edited: Matt J
on 19 Mar 2025
If you don't know which x(i) belong to the well-determined subset, you would need to do a null space analysis, I think.
A=rand(10);
A(:,3:end)=randn; %reduce rank
A=A(:,randperm(end));
b=3*A(:,1)+2*A(:,2);
N=null(A)
Here, we see that the rows 7 and 10 of N are numerically 0. This tells us that the well-determined components are x(7) and x(10), because no matter what null vector you add to x, x(7) and x(10) will not change. So, you can now do,
x=lsqminnorm(A,b);
x=x([7,10]);
More Answers (1)
John D'Errico
on 19 Mar 2025
The largest subset? It may be impossible to compute ANY subset accurately. You may be able to only compute a linear combination of the variables with any accuracy. For example:
A = rand(10,1)*[1 1] + randn(10,2)*1e-16;
b = randn(10,1);
If you look at A, you will see the first and second columns are virtually identical, down to about the 16th decimal place.
format long g
A
Now, suppose you want to estimate the vector X=[x1;x2], such that
A*X == b
using linear least squares? Essentially, you cannot estimate either of the variables x1 or x2 well. We can try this:
Xslash = A\b
Xsvd = lsqminnorm(A,b)
There simply is no information content in your data to estimate either x1 or x2 well, while ignoring the other. The only information content in this data lies effectively in the direction x1+x2. And you can do that reasonably well.
Unfortunately, this will often be the case. We can learn what information is lacking by use of svd, but null will do too.
null(A)
And that tells me what you cannot learn is any information about the DIFFERENCE of the two unknowns, as that is where the nullspace lies.
It would have been as easy to generate different data that would fail in some different direction. The problem is, much of the time when you have an ill-conditioned system, there will be no single variables you can estimate truly well, and the others will be less well known. This is easy enough to build such a classic example.
x = rand(100,1);
A = x.^(0:20); % A simple high order polynomial model, constant term first
y = randn(100,1);
A\y
Now, we can try using a tool like lsqminnorm, and I suppose you can say the lowest order terms (constant term, linear term) are at least somewhat better estimated than the rest. The others get worse and worse as you go down the line, but there is no simple dividing line where I would decide which of the unknowns are well-estimated.
lsqminnorm(A,y)
1 Comment
John D'Errico
on 20 Mar 2025
I think what you misunderstand is it is almost never the case where one variable is well defined, and others are not. Almost always it is that some LINEAR combination of the unknowns is poorly defined.
For example, it may be that there is no information available about the linear combination a-2*b. What this means is you can choose ANY value of a, and this will imply the value of b as a/2. In that case, while pinv or lsqminnorm will give you AN answer, it will not tell you the slightest bit of help on what any specific variable must be.
See Also
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!