Indeed, I suggested in that OR SE post to post it here, but with my assessment that I doubt there is a DCP representation for T; and I also suggested it is a likely candidate for @Erling 's Challenge
I haven’t yet found a representation, but I found some interesting things which I detail in the OR stack Exchange post I made, which was linked by @Erling.
I found a way to write T as the sum of three concave functions.
Two of them are easy to write as a DCP function, by using the partial_optimize transform.
The third one is kind of tricky, but I think I might be almost there
If someone answers there, or if I find the result I’ll be sure to post it here for completion, but the question now essentially boils down to finding a DCP representation of -\log(t)\log(1-t), for t\in(0,1).
What I did was write: 2\log(t)\log(1-t) = \log(t(1-t))^2 - \log(t/(1-t))^2, and try to write it as another partial_optimize construct. Essentially:
If I understand correctly, ptp(x) = max(x) -min(x). So I don’t see how ptp could accept a non-affine argument, as you are proposing. because max requires a convex argument and min requires a concave argument. Am I wrong?
https://www.cvxpy.org/api_reference/cvxpy.atoms.other_atoms.html#ptp doesn’t indicate argument requirements. Are they documented somewhere?
where z_k for k\in\{0,N_t\} discretizes the interval [0,1].
I’ve tried this for a simple, univariate problem and it worked beautifully!
Now, is there a way to make a sort of elementwise version of this in CVXPY? i.e.: receive a vector/matrix \mathbf{t} and return -\log(\mathbf{t})\log(1-\mathbf{t}) where the evaluation is elementwise?
I followed the recipe from my talk at https://youtu.be/2G6xbQZHDHk?t=684 and found a representation of t \geq -\log(x) \log(1-x) which satisfies all composition rules, namely
t \geq - s \log\left( 1 - \exp(r/s) \right),\quad r \geq p^2,\quad s=p,\quad p \leq \log(x),
representable as
s\exp(-t/s) + s\exp(r/s) \leq s,\quad r \geq p^2,\quad s=p,\quad p \leq \log(x).
The problem is that the domain on which this representation is exact is limited to x=1, where t \geq 0 is implied, since s = p \leq \log(x) \leq 0 on x \leq 1, and s \geq 0 by its use as a perspective variable. This is a show stopper. Hope your approximation turns out to be useful.