Power function (with 0<p<1) does not respect DCP rules
denizalp opened this issue · comments
I think the power function with exponent 1 > p > 0 does not correctly update the DCP status of an expression. When I look at the CRAN documentation (page 347) I see:
"[the power] function is convex, decreasing, and positive. For 0 < p < 1 and f(x) = x^p for x ≥ 0"
This statement is wrong (unless If I am really missing something) and is not in agreement with the python documentation which states that the power function is "concave, positive, increasing for 0< p < 1 "
Been getting DCP errors on a program and using the is_DCP argument did not help.
Thanks for the documentation note which we will fix: it is correct, but the typesetting is leading you to read it incorrectly. But what do you base your first statement upon? See below.
> library(CVXR)
Attaching package: ‘CVXR’
The following object is masked from ‘package:stats’:
power
> x <- Variable(3)
> p <- power(x, 0.5)
> is_dcp(p)
[1] TRUE
> is_convex(p)
[1] FALSE
> is_concave(p)
[1] TRUE