# 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