Do I need to find Hessian matrix? or is there any other method ?
-
$\log$ is concave, not convex – Stefan Nov 12 '13 at 15:38
-
More general version here – Jun 12 '14 at 05:06
2 Answers
The function $\;f(x,y)=\log(e^x+e^y)\;$ is convex iff the function
$$\;g(t):=f(\vec x+t\vec y)=\log\left(e^{x_1+ty_1}+e^{x_2+ty_2}\right)\;$$ is convex, but:
$$\begin{align*}g'(t)&=\frac{y_1e^{x_1+ty_1}+y_2e^{x_2+ty_2}}{e^{x_1+ty_1}+e^{x_2+ty_2}}\\{}\\g''(t)&=\frac{\left(y_1^2e^{x_1+ty_1}+y_2^2e^{x_2+ty_2}\right)(e^{x_1+ty_1}+e^{x_2+ty_2})-(y_1e^{x_1+ty_1}+y_2e^{x_2+ty_2})^2}{(e^{x_1+ty_1}+e^{x_2+ty_2})^2}\end{align*}\;$$
- 211,718
- 17
- 136
- 287
-
-
-
Wouldn't it be $\dfrac{y_1e^{x_1+ty_1}+y_2e^{x_2+ty_2}}{e^{x_1+ty_1}+e^{x_2+ty_2}}$? – Ross B. Nov 12 '13 at 16:09
-
Oh, you meant $;g'(t);$....yes, you're right. Thanks and editing on its way. – DonAntonio Nov 12 '13 at 16:12
-
can i show that Eigen values are positive semi-definite and that is why it is convex? – user107637 Nov 13 '13 at 00:01
-
@RossB.can i show that Eigen values are positive semi-definite and that is why it is convex? – user107637 Nov 13 '13 at 00:16
Let $f(x_1,x_2)=\log\big(e^{x_1}+e^{x_2} \big)$.
No you do not necessarily need to calculate the Hessian. You can prove that for every curve
$\alpha(t)=(x_1(t),x_2(t))$ such that $\alpha(0)=(x_1,x_2)$ for all $(x_1,x_2)$ and $t$
$$
g^{\prime\prime}(t)=(f\circ \alpha)^{\prime\prime}(t)\geq 0
$$
But calculating the Hessian of this function is not as laborious as well.We need prove that $\quad \forall v=(v_1,v_2)\in\mathbb{R}^2$
\begin{align}
v \cdot \mbox{Hess}f(x_1,x_2)\cdot v^T
=
&
\left[v_1,v_2 \right]\cdot
\left[
\begin{array}{cc}
\frac{\partial\, f(x_1,x_2)}{\partial x_1\partial x_1}
&
\frac{\partial\, f(x_1,x_2)}{\partial x_2\partial x_1}
\\
\frac{\partial\, f(x_1,x_2)}{\partial x_1\partial x_2}
&
\frac{\partial\, f(x_1,x_2)}{\partial x_2\partial x_2}
\end{array}
\right]
\cdot
\left[\begin{array}{c}v_1\\v_2 \end{array}\right]\geq 0,
\\
=&\frac{\partial\, f(x_1,x_2)}{\partial x_1\partial x_1}v_1v_1 +
\frac{\partial\, f(x_1,x_2)}{\partial x_1\partial x_2}v_1v_2 \\
+&\frac{\partial\, f(x_1,x_2)}{\partial x_2\partial x_1}v_2v_1 +
\frac{\partial\, f(x_1,x_2)}{\partial x_2\partial x_2}v_2v_2 \geq0
\end{align}
We have
\begin{align}
v \cdot \mbox{Hess}f(x_1,x_2)\cdot v^T
=
&
\left[v_1,v_2 \right]\cdot
\left[
\begin{array}{cc}
\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}}
&
-\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}}
\\
-\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}}
&
\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}}
\end{array}
\right]
\cdot
\left[\begin{array}{c}v_1\\v_2 \end{array}\right]
\\
=&\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}}\left(v_1^2-2v_1v_2+v_2^2 \right)
\\
=&
\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}}\left(v_1-v_2 \right)^2\geq 0
\end{align}
Partial derivatives \begin{align} \frac{\partial\, f(x_1,x_2)}{\partial x_1\partial x_1} = & \frac{\partial\,}{\partial x_1\partial x_1}\log( e^{x_1}+e^{x_1}) = \frac{\partial\,}{\partial x_1}\left(\frac{e^{x_1}}{e^{x_1}+e^{x_2}}\right) \\ = & \frac{(e^{x_1})_{x_1}(e^{x_1}+e^{x_2})-(e^{x_1})(e^{x_1}+e^{x_2})_{x_1}}{(e^{x_1}+e^{x_2})^2} = \frac{e^{x_1}e^{x_2}}{(e^{x_1}+e^{x_2})^2} \end{align} analogously $$ \frac{\partial\, f(x_1,x_2)}{\partial x_2\partial x_2}=\frac{e^{x_1}e^{x_2}}{(e^{x_1}+e^{x_2})^2} $$ and $$ \frac{\partial\, f(x_1,x_2)}{\partial x_2\partial x_1}= \frac{\partial\, f(x_1,x_2)}{\partial x_1\partial x_2} = \frac{\partial\,}{\partial x_2\partial x_1}\log( e^{x_1}+e^{x_1}) = \frac{\partial\,}{\partial x_2}\left(\frac{e^{x_1}}{e^{x_1}+e^{x_2}}\right) = -\frac{e^{x_1}\cdot e^{x_2}}{e^{x_1}+e^{x_2}} $$
- 14,658
-
Along these lines, a derivation for the convexity of the log-sum-exp function in general (i.e. summing $n$ exp's) using slightly more compact notation can also be found in "Convex Optimization" by Body & Vandenberghe. – Ross B. Nov 12 '13 at 17:43