Hi,
I have the following simple projection on an l2-ball with a radius of 10. However, it gives me infeasible solution for the evaluation point as a 1001 vector with -510^3 for each entry. Can someone halp me?
cvx_begin quiet
variable w_sol(n)
%minimize(0.5*(w_sol - eval_point)‘(w_sol - eval_point));
minimize(0.5(w_sol - eval_point)’*(w_sol - eval_point));
%minimize(pow_abs(w_sol - eval_point,2));
subject to
norm(w_sol) <= D_x;
cvx_end
Also I have tried sum_square_abs or other things but it is always infeasible.
TLDR: Garbage in. Garbage out.
Don’t use quiet
. Then you will see all the solver and CVX output.
Your program only has one constraint. It should in actuality be feasible if D_x >= 0
. However, if the scaling of the input data is very bad, it is possible for that bad scaling to get coupled into the constraints, and make what is really a feasible problem be assessed as infeasible by the solver. I think that’s what happened with evaluation_point
having entries of 510^3. That is approximately 1.3e8, and then that is getting squared. So absolutely horrendous.
You could improve things somewhat by minimizing norm(w_sol - eval_point)
instead of the quadratic; that would at least improve the conditioning somewhat. But the other thing you absolutely should do is change units so that there are not enormous numbers such as 500^3. If D_x
is currently 10 (not sure I am interpreting that correctly), then you need to make that commensurately smaller, Perhaps it will be excessively small? If so, maybe your problem is inherently ill-conditioned. It seems to me that it is crazy to minimize something against data of order 510^3 and expect the length 1001 2-norm of the minimizer to be <= 10. This residuals would be gargantuan, and it seems to me that the fit would be horrendous, and the fitting process (projection?) amount to meaningless garbage. If I have correctly interpreted what your input data is, I think you need to rethink what you’re doing, because it is not just a matter of improving numerical scaling; you haver a fundamental mismatch between eval_point
and D_x
. On the other hand, if eval_point
having 500^3 entries is just a test of your procedure, it’s a very poor test, and you should put in realistic data which is compatible (in some sense) with the D_x
.
Thanks! That is right! I am just trying to produce synthetic data to implement an algorithm! As I tuned the parameters of the problem, the issue was resolved.