Ill-posed quadratic programing with linear inequality constraint
1 view (last 30 days)
Show older comments
I have the problem
min |Q*x-d| subject to A*x <= b and x>0
The matrix Q has very large condition number. How can I solve this using Matlab? I looked at Hansen's regularization tool package but it does not appear to handle the linear inequality and nonnegativity. Thanks very much for help
0 Comments
Answers (1)
John D'Errico
on 6 Oct 2020
An old question, so my answer is completely irrelevant to Benjamin. Sorry about being late on this. But the solution is not that difficult. First, don't use quadprog or quadratic programming for this. The simple solution uses lsqlin anyway.
A = rand(2,10);
b = rand(2,1);
Q = randn(30,9)*randn(9,10);
d = randn(30,1);
lb = zeros(10,1);
So Q is clearly rank deficient. It has rank exactly 9 by construction, and the condition number of Q is effectively a numerical inf in terms of double precision.
rank(Q)
cond(Q)
lsqlin(Q,d,A,b,[],[],lb)
Yes, we could solve it using quadprog with a regularization. Entirely doable. But why bother? lsqlin is able to solve it.
3 Comments
See Also
Categories
Find more on Linear Least Squares 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!