$f(x)=\log(e^{x_1}+\cdots+e^{x_n})$ is convex or not?

152 Views Asked by At

Question: If $x\in\mathbb{R^n}$, then $f(x)=\log(e^{x_1}+\cdots+e^{x_n})$ is convex or not?

For $x\in\mathbb{R}$, $f(x)=\log(e^x)$ is convex since it is a line. Or using the definition of linearity, $$\alpha f(x)+\beta f(y)=\log(e^{\alpha x})+\log(e^{\beta y})=\log(e^{\alpha x+\beta y})=f(\alpha x+\beta y)~,$$ thus $f(x)$ is convex.

I have plotted $f(x)$ for $x\in\mathbb{R^2}$, it doesn't look like convex. But how we can show it?

We also can rewrite $f(x)=h(g(x))$, where $h(x)$ is concave and $g(x)$ is convex, but is it helpful? I couldn't find any convex preserving operation based on that.

2

There are 2 best solutions below

0
On BEST ANSWER

Since $\frac{\partial^2 f}{\partial x_k^2}=\frac{\sum_{i\neq k}e^{x_i+x_k}}{(\sum_{i=1}^n e^{x_i})^2}$ and $\frac{\partial^2 f}{\partial x_s x_t}=-\frac{e^{x_s+x_t}}{(\sum_{i=1}^n e^{x_i})^2}$

So the sum of all elements in each row is 0 only the diagonal elements of Hessian matrix is positive. It is diagonally dominant matrix so that the Hessian matrix is positive semidefinite and f(x) is convex

0
On

Log-sum-exp is convex because its epigraph is convex, and that you can see by constructing a simple convex representation as in https://docs.mosek.com/modeling-cookbook/expo.html#log-sum-exp, namely the epigraph inequality:

$$t\geq \log\sum_i e^{x_i}$$

is equivalent to

$$u_i\geq e^{x_i-t},\quad \sum_i u_i=1.$$