$\log(\frac{1+x\ (a+1)}{1+x \ a})$ and its perspective $y\log(\frac{1+x/y\ (a+1)}{1+x/y \ a})$ in CVX

Hi,

im trying to implement in CVX the following convex function -\log(\frac{1+x\ (a+1)}{1+x \ a}) with a a postive constant, and I got an error which I think is because of the DCP ruleset. Could you please help me add this function to CVX?

The same goes for the case in which the perspective operator is applied: -y\log(\frac{1+x/y\ (a+1)}{1+x/y \ a}). How could I include this expression in CVX?

I would appreciate your help.
Thanks

I am not convinced that this function is convex or concave. But even if it is, I am afraid it is quite unlikely that it can be represented in CVX.

Thank you very much for your answer. The first expression can be shown to be convex, and the perspective operation preserves convexity [Boyd 3.2.6], therefore the second is convex too.

After some manipulation I obtained the following:

$$-y\log(\frac{1+x/y\ (a+1)}{1+x/y \ a})= y\log(\frac{y}{y+ x(a+1)}) -y\log(\frac{y}{y+ x\ a})$$

I tried introducing it in cvx as: rel_entr(y, y + x*(a+1)- rel_entr(y, y + x*a) and got the DCP error Illegal operation: {convex} - {convex}

Any ideas?

No, I am afraid not. Unfortunately, convexity is not sufficient to establish that a function can be expressed in CVX. CVX simply does not support arbitrary convex functions, as it uses a unique geometric representation method.

According to my analysis, this function is convex for x> -1/(a+1), which is I assume the branch you are interested in. Again, unfortunately, I do not believe CVX can handle it.

Again, thank you very much for your answer and your analysis. I am indeed interested in the branch for x>=0 with a>=0, and will try to find another way to solve.