How to express the following function in cvx


(Tang) #1

I’m trying to implement in cvx the following concave function
\log_2{[(a_1*x+1)(a_2*x+a_3*y+1)+a_2*x*a_3*y]}
where a1,a2,a3 are constants.
But cvx reports the error:
Error using times>times_q (line 84)
Disciplined convex programming error:
Invalid quadratic form(s): not a square.


(Mark L. Stone) #2

There is an x*y term, which is indefinite, hence not concave, which the argument of log must be to be accepted by CVX.

This is not just a matter of CVX not realizing it’s concave. It is NOT concave. For example, let
a1 = 1, a2 = -1, a3 = 1, x= -1, y = -2. Then the eigenvalues of the Hessian are -1/ln(2) and 1/ln(2), hence indefinite. Yes, it’s true that it is concave at some values of x and y, but that’s not good enough.


(Tang) #3

Thank you for your reply.
I forgot to mention that a1,a2,a3 are positive constants and x, y are positive, too.


(Mark L. Stone) #4

The function may indeed be concave under those restrictions. However, it is in violation of CVX’s rules which require that the argument of log be concave. And there would still be the matter of restricting x and y to be positive. I don’t see how to implement this in CVX and strongly suspect it can not be done.