Is this generalized KL divergence function convex?

82 Views Asked by At

I have a positive vector $\mathbf{x}$ and its approximation (also positive) $\mathbf{r}$, and I would like to minimize the generalized KL divergence between the former and the latter using gradient descent. Hence, I would like to know if this is a convex function (because that would guarantee that any local minimum discovered by gradient descent is also a global minimum).

$$D_{KL}(\mathbf{x,r}) = \sum_i [x_i\log\frac{x_i}{r_i} -x_i + r_i]$$

Is this a convex function in $\mathbf{x}$ and $\mathbf{r}$? Is it convex only when $\mathbf{x}$ is fixed?

I found this definition, but I could not get any further: A function $f$ is convex when for every segment $[x_1,x_2]$ as $x_t = tx_1 + (1-t)x_2$ varies over the line segment $[x_1,x_2]$, the points $(x_t, f(x_t))$ lie below the segment connecting $(x_1, f(x_1))$ and $(x_2, f(x_2))$. In my context, what is $x_1$ and what is $x_2$? How can I determine convexity for my two vector variable function?