Problem with using MATRIX_FRAC

(farid) #1

My optimization problem is jointly convex for the positive values of the optimization variable. It comes as follows:

cvx_begin gp
variable J1_part1

minimize(J1_part1*zigmabarlocalnormal(1,1) - J1_part1*matrix_frac(si,zigmabarlocalnormal(2:num,2:num)+J1_part1*constant*eye(num-1)) - log_det(J1_part1));


Unfortunately, I confront with a disciplined convex programming error (MATRIX_FRAC is convex and nonmonotonic, so its input must be affine). I do not know how to rephrase the second term (out of three) of the optimization problem to be understandable by CVX. Could you please help me.
(The other variables which appear in the optimization problem are either constant scalars or constant matrices)


(Mark L. Stone) #2

How have you proven this to be convex? Do you have a constructive proof consistent with CVX’s DCP rules?

(farid) #3

Thank you for the reply.
I plotted each term versus positive values of J1_part1 and checked the convexity. I also checked the second derivative by hand calculations.

(Mark L. Stone) #4

Show us the proof that the 2nd term is convex.

I haven’t checked in higher dimensions, but in 1 dimension, the 2nd term can only be convex over a limited portion of the reals. That is likely to be problematic for prospects of representing in CVX, even though you have added a constraint on J1part1.

(farid) #5

The most convenient way is plotting it versus positive values of J1_part1:
si =



42.6962 44.1458
44.1458 51.8904

constant =



 1     0
 0     1

Using the above values as the parameters of the second term of the optimization problem, this figure always shows a convex behavior for positive values of optimization variable.

I have also tried a mathematical proof for the second derivative but the math gets a bit complicated to bring here.

(Mark L. Stone) #6

Perhaps it is convex. But I don’t see how to get it accepted by CVX. I am not ruling out that someone else does.

(farid) #7

Let’s consider a simpler convex problem as follows:

si =[

cvx_begin gp
variable J1_part1

minimize(J1_part1*zigmabarlocalnormal(1,1) + matrix_frac(si,J1_part1*constant*eye(num-1)));

1e-4 <= J1_part1;


It still gives a disciplined convex programming error!

(Mark L. Stone) #8

Your problem immediately above will be accepted if you don’t use gp mode.

(farid) #9

Yeah. I made a mistake. Thanks.
However, the original problem cannot still be solved by cvx, even if we do not use a gp mode.

(farid) #10

The error is:
Cannot perform the operation: {real affine} .* {convex}