Ill-posed quadratic programing with linear inequality constraint

1 view (last 30 days)
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

Answers (1)

John D'Errico
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)
ans = 9
cond(Q)
ans = 1.7291e+16
lsqlin(Q,d,A,b,[],[],lb)
Minimum found that satisfies the constraints. Optimization completed because the objective function is non-decreasing in feasible directions, to within the value of the optimality tolerance, and constraints are satisfied to within the value of the constraint tolerance.
ans = 10×1
0.0000 0.0239 0.0000 0.2663 0.0000 0.2278 0.0000 0.0827 0.0000 0.0000
Yes, we could solve it using quadprog with a regularization. Entirely doable. But why bother? lsqlin is able to solve it.
  3 Comments
John D'Errico
John D'Errico on 7 Oct 2020
true, in that it could be lower rank. A highly improbable event though.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!