How to express this function?


(EHTISHAM ASGHAR) #1

f(x) = 100*(x^2 - y)^2 + (1 - x)^2

can be expressed as?
cvx_begin
variables x y;
minimize(100*square_pos(square(x)-y) + square(1-x));
cvx_end

Please answer?


(Mark L. Stone) #2

f(x) is the Rosenbrock function, which is non-convex. For example, at x = y = 0.98, its Hessian has one positive and one negative eigenvalue, and therefore is indefinite. Therefore, CVX will not accept this function,

That said, the program you provided is valid CVX code, and will be accepted by CVX and solved. But the objective function is not the Rosenbrock function. The use of square_pos on square(x)-y) means that square(x)-y is evaluated to zero if y > square(x). Therefore, the solution x = 1 with y any value >= 1 is optimal for this problem, even though x = y = 1 is the unique global optimum for the Rosenbrock function. The CVX solution will have optimal y >= 1, and quite possibly > 1, which solves the problem entered, but may not minimize the Rosenbrock function…


(EHTISHAM ASGHAR) #3

sir thank you very much for your answer.
I get your point so, can I convert my function f(x) into any other convex form except using square_pos?


(Mark L. Stone) #4

The function f(x) is not convex. The only way to convert it to being convex is to change it to a different function. Then that would not be the original f(x).


(EHTISHAM ASGHAR) #5

Thank you very much mark