1、凸函数的定义1
凸函数:若函数 f : R n → R f:R^n \rightarrow R f:Rn→R是凸函数,则他需要满足两个条件:
- d o m f dom \space f dom f是凸集
- ∀ x , y ∈ d o m f , 0 ≤ θ ≤ 1 \forall \space x,y \in dom \space f,0 \leq \theta \leq 1 ∀ x,y∈dom f,0≤θ≤1,有 f ( θ x + ( 1 − θ ) y ) ≤ θ f ( x ) + ( 1 − θ ) f ( y ) f(\theta x+(1-\theta)y) \leq \theta f(x)+(1-\theta)f(y) f(θx+(1−θ)y)≤θf(x)+(1−θ)f(y)
凸函数的扩展:若函数 f : R n → R f:R^n \rightarrow R f:Rn→R是凸函数, d o m f = C ⊆ R n dom \space f=C \subseteq R^n dom f=C⊆Rn,则凸函数的扩展
f
~
=
{
f
(
x
)
,
x
∈
d
o
m
f
+
∞
,
x
∉
d
o
m
f
\widetilde{f}=\left\{ \begin{matrix} f(x),x\in dom \space f\\ +\infty ,x \notin dom \space f \end{matrix} \right.
f
={f(x),x∈dom f+∞,x∈/dom f
仍为凸函数
Ex1:示性函数是凸函数
凸集
C
⊆
R
n
C \subseteq R^n
C⊆Rn
示
性
函
数
f
c
(
x
)
=
{
无
定
义
,
x
∉
C
0
,
x
∈
C
为
凸
函
数
示性函数f_c(x)=\left\{ \begin{matrix} 无定义,x \notin C \\ 0,\space\space x \in C \end{matrix} \right.为凸函数
示性函数fc(x)={无定义,x∈/C0, x∈C为凸函数
示性函数的扩展
I
c
(
x
)
=
{
+
∞
,
x
∉
C
0
,
x
∈
C
为
凸
函
数
I_c(x)=\left\{ \begin{matrix} +\infty,x \notin C \\ 0,\space\space x \in C \end{matrix} \right.为凸函数
Ic(x)={+∞,x∈/C0, x∈C为凸函数
2、凸函数的定义2:高维到低维
函数是凸的,当且仅当其在与其定义域相交的任何直线上都是凸的
f
为
凸
函
数
⇔
∀
x
∈
d
o
m
f
,
∀
v
,
g
(
t
)
=
f
(
x
+
t
v
)
为
凸
,
其
中
d
o
m
g
=
{
t
∣
x
+
t
v
∈
d
o
m
f
}
f为凸函数 \Leftrightarrow\\ \forall \space x \in dom \space f, \forall \space v, g(t)=f(x+tv)为凸,其中dom \space g=\{t \mid x+tv \in dom \space f\}
f为凸函数⇔∀ x∈dom f,∀ v,g(t)=f(x+tv)为凸,其中dom g={t∣x+tv∈dom f}
3、凸函数的定义3:一阶条件(若函数一阶倒数存在)
设 f : R n → R f:R^n \rightarrow R f:Rn→R可微,即梯度 ▽ f \triangledown f ▽f在 d o m f dom \space f dom f上均存在,则 f f f为凸函数等价于:
- d o m f dom \space f dom f为凸
- f ( y ) ≥ f ( x ) + ▽ f T ( x ) ( y − x ) , ∀ x , y ∈ d o m f f(y) \geq f(x) + \triangledown f^T(x)(y-x),\forall \space x,y \in dom \space f f(y)≥f(x)+▽fT(x)(y−x),∀ x,y∈dom f
下图为等价定义的简单理解:
证明一阶条件:
首先考虑一维情况: f : R → R f:R \rightarrow R f:R→R为凸函数 ⇔ d o m f \Leftrightarrow dom \space f ⇔dom f为凸且 f ( y ) ≥ f ( x ) + f ′ ( x ) ( y − x ) f(y) \geq f(x)+f'(x)(y-x) f(y)≥f(x)+f′(x)(y−x)
充分性证明:
f
为
凸
,
∀
x
,
y
∈
d
o
m
f
为
凸
∀
t
,
0
≤
t
≤
1
,
x
+
t
(
y
−
x
)
∈
d
o
m
f
f
(
x
+
t
(
y
−
x
)
)
≤
(
1
−
t
)
f
(
x
)
+
t
f
(
y
)
t
f
(
y
)
≥
t
f
(
x
)
+
f
(
x
+
t
(
y
−
x
)
)
−
f
(
x
)
f
(
y
)
≥
f
(
x
)
+
f
(
x
+
t
(
y
−
x
)
)
−
f
(
x
)
t
,
对
于
∀
t
都
成
立
两
侧
对
t
取
极
限
,
有
:
f
(
y
)
≥
f
(
x
)
+
f
′
(
x
)
(
y
−
x
)
得
证
f为凸,\forall \space x,y \in dom \space f 为凸\\ \forall \space t,0 \leq t \leq 1,x+t(y-x)\in dom \space f\\ f(x+t(y-x)) \leq (1-t)f(x)+tf(y)\\ tf(y) \geq tf(x)+f(x+t(y-x))-f(x)\\ f(y) \geq f(x)+\frac{f(x+t(y-x))-f(x)}{t},对于\forall \space t都成立\\ 两侧对t取极限,有:f(y) \geq f(x)+f'(x)(y-x)得证\\
f为凸,∀ x,y∈dom f为凸∀ t,0≤t≤1,x+t(y−x)∈dom ff(x+t(y−x))≤(1−t)f(x)+tf(y)tf(y)≥tf(x)+f(x+t(y−x))−f(x)f(y)≥f(x)+tf(x+t(y−x))−f(x),对于∀ t都成立两侧对t取极限,有:f(y)≥f(x)+f′(x)(y−x)得证
必要性证明:
设
∀
x
≠
y
,
x
,
y
∈
d
o
m
f
,
0
≤
θ
≤
1
构
造
z
=
θ
x
+
(
1
−
θ
)
y
∈
d
o
m
f
{
f
(
x
)
≥
f
(
z
)
+
f
′
(
z
)
(
x
−
z
)
f
(
y
)
≥
f
(
z
)
+
f
′
(
z
)
(
y
−
z
)
⇒
θ
f
(
x
)
+
(
1
−
θ
)
f
(
y
)
≥
f
(
z
)
+
[
θ
(
x
−
z
)
+
(
1
−
θ
)
(
y
−
z
)
]
f
′
(
z
)
≥
f
(
z
)
+
(
θ
x
+
(
1
−
θ
)
y
−
z
)
f
′
(
z
)
⇒
θ
f
(
x
)
+
(
1
−
θ
)
f
(
y
)
≥
f
(
z
)
当
x
=
y
时
,
z
=
θ
x
+
(
1
−
θ
)
y
=
x
f
(
x
)
≥
f
(
z
)
恒
成
立
,
得
证
设\forall \space x \neq y,x,y\in dom \space f,\space 0 \leq \theta \leq 1\\ 构造z=\theta x+(1-\theta)y \in dom \space f\\ \left\{ \begin{matrix} f(x) \geq f(z)+f'(z)(x-z)\\ f(y) \geq f(z)+f'(z)(y-z)\\ \end{matrix} \right.\\ \Rightarrow \theta f(x)+(1-\theta)f(y)\geq f(z)+[\theta(x-z)+(1-\theta)(y-z)]f'(z)\\ \geq f(z)+(\theta x+(1-\theta)y-z)f'(z)\\ \Rightarrow\theta f(x)+(1-\theta)f(y)\geq f(z)\\ 当x=y时,z=\theta x+(1-\theta)y=x\\ f(x) \geq f(z)恒成立,得证
设∀ x=y,x,y∈dom f, 0≤θ≤1构造z=θx+(1−θ)y∈dom f{f(x)≥f(z)+f′(z)(x−z)f(y)≥f(z)+f′(z)(y−z)⇒θf(x)+(1−θ)f(y)≥f(z)+[θ(x−z)+(1−θ)(y−z)]f′(z)≥f(z)+(θx+(1−θ)y−z)f′(z)⇒θf(x)+(1−θ)f(y)≥f(z)当x=y时,z=θx+(1−θ)y=xf(x)≥f(z)恒成立,得证
下面扩展到高维情况:
即 f u n c t i o n f i s c o n v e x ⇔ d o m f i s c o n v e x a n d f ( y ) ≥ f ( x ) + ▽ f T ( x ) ( y − x ) , ∀ x , y ∈ d o m f function \space f \space is \space convex \Leftrightarrow dom \space f \space is \space convex \space and \space f(y) \geq f(x) + \triangledown f^T(x)(y-x),\forall \space x,y \in dom \space f function f is convex⇔dom f is convex and f(y)≥f(x)+▽fT(x)(y−x),∀ x,y∈dom f
充分性证明:
要
证
:
f
为
凸
函
数
⇒
d
o
m
f
为
凸
,
且
f
(
y
)
≥
f
(
x
)
+
▽
f
T
(
x
)
(
y
−
x
)
f
为
凸
函
数
,
则
由
第
一
个
定
义
可
知
,
d
o
m
f
一
定
为
凸
g
(
t
)
=
f
(
t
y
+
(
1
−
t
)
x
)
,
t
y
+
(
1
−
t
)
x
是
仿
射
组
合
g
(
t
)
=
f
(
x
+
t
(
y
−
x
)
)
g
′
(
t
)
=
▽
f
T
(
t
y
+
(
1
−
t
)
x
)
(
y
−
x
)
由
定
义
2
以
及
一
维
情
况
有
:
g
(
t
1
)
≥
g
(
t
2
)
+
g
′
(
t
2
)
(
t
1
−
t
2
)
∀
t
1
,
t
2
都
成
立
,
令
t
1
=
1
,
t
2
=
0
g
(
1
)
≥
g
(
0
)
+
g
′
(
0
)
⇒
f
(
y
)
≥
f
(
x
)
+
▽
f
T
(
x
)
(
y
−
x
)
得
证
要证:f为凸函数 \Rightarrow dom \space f为凸,且f(y) \geq f(x) + \triangledown f^T(x)(y-x)\\ f为凸函数,则由第一个定义可知,dom \space f一定为凸\\ g(t)=f(ty+(1-t)x),ty+(1-t)x是仿射组合\\ g(t)=f(x+t(y-x))\\ g'(t)=\triangledown f^T(ty+(1-t)x)(y-x)\\ 由定义2以及一维情况有:\\ g(t_1)\geq g(t_2)+g'(t_2)(t_1-t_2)\\ \forall \space t_1,t_2都成立,令t_1=1,t_2=0\\ g(1)\geq g(0)+g'(0)\\ \Rightarrow f(y) \geq f(x)+ \triangledown f^T(x)(y-x)得证
要证:f为凸函数⇒dom f为凸,且f(y)≥f(x)+▽fT(x)(y−x)f为凸函数,则由第一个定义可知,dom f一定为凸g(t)=f(ty+(1−t)x),ty+(1−t)x是仿射组合g(t)=f(x+t(y−x))g′(t)=▽fT(ty+(1−t)x)(y−x)由定义2以及一维情况有:g(t1)≥g(t2)+g′(t2)(t1−t2)∀ t1,t2都成立,令t1=1,t2=0g(1)≥g(0)+g′(0)⇒f(y)≥f(x)+▽fT(x)(y−x)得证
必要性证明:
要
证
:
d
o
m
f
为
凸
,
且
f
(
y
)
≥
f
(
x
)
+
▽
f
T
(
x
)
(
y
−
x
)
⇒
f
为
凸
函
数
∀
x
,
y
∈
d
o
m
f
,
t
y
+
(
1
−
t
)
x
∈
d
o
m
f
t
~
y
+
(
1
−
t
~
)
x
∈
d
o
m
f
将
上
述
两
点
代
入
已
知
得
:
f
(
t
y
+
(
1
−
t
)
x
)
≥
f
(
t
~
y
+
(
1
−
t
~
)
x
)
+
▽
f
(
t
~
y
+
(
1
−
t
~
)
x
)
(
t
y
+
(
1
−
t
)
x
−
t
~
y
−
(
1
−
t
~
)
x
)
⇒
f
(
t
y
+
(
1
−
t
)
x
)
≥
f
(
t
~
y
+
(
1
−
t
~
)
x
)
+
▽
f
(
t
~
y
+
(
1
−
t
~
)
x
)
(
y
−
x
)
(
t
−
t
~
)
定
义
函
数
g
(
t
)
=
f
(
t
y
+
(
1
−
t
)
x
)
,
g
(
t
~
)
=
f
(
t
~
y
+
(
1
−
t
~
)
x
)
g
′
(
t
~
)
=
▽
f
T
(
t
~
y
+
(
1
−
t
~
)
x
)
(
y
−
x
)
⇒
g
(
t
)
≥
g
(
t
~
)
+
g
′
(
t
~
)
(
t
−
t
~
)
由
定
义
2
可
知
,
f
为
凸
函
数
要证:dom \space f为凸,且f(y) \geq f(x) + \triangledown f^T(x)(y-x)\Rightarrow f为凸函数 \\ \forall \space x,y \in dom \space f,ty+(1-t)x \in dom \space f\\ \widetilde{t}y+(1-\widetilde{t})x \in dom \space f\\ 将上述两点代入已知得:\\ f(ty+(1-t)x)\geq f(\widetilde{t}y+(1-\widetilde{t})x)+\triangledown f(\widetilde{t}y+(1-\widetilde{t})x)(ty+(1-t)x-\widetilde{t}y-(1-\widetilde{t})x)\\ \Rightarrow f(ty+(1-t)x)\geq f(\widetilde{t}y+(1-\widetilde{t})x)+\triangledown f(\widetilde{t}y+(1-\widetilde{t})x)(y-x)(t-\widetilde{t})\\ 定义函数g(t)=f(ty+(1-t)x),g(\widetilde{t})=f(\widetilde{t}y+(1-\widetilde{t})x)\\ g'(\widetilde{t})=\triangledown f^T(\widetilde{t} y+(1-\widetilde{t})x)(y-x)\\ \Rightarrow g(t) \geq g(\widetilde{t})+g'(\widetilde{t})(t-\widetilde{t})\\ 由定义2可知,f为凸函数
要证:dom f为凸,且f(y)≥f(x)+▽fT(x)(y−x)⇒f为凸函数∀ x,y∈dom f,ty+(1−t)x∈dom ft
y+(1−t
)x∈dom f将上述两点代入已知得:f(ty+(1−t)x)≥f(t
y+(1−t
)x)+▽f(t
y+(1−t
)x)(ty+(1−t)x−t
y−(1−t
)x)⇒f(ty+(1−t)x)≥f(t
y+(1−t
)x)+▽f(t
y+(1−t
)x)(y−x)(t−t
)定义函数g(t)=f(ty+(1−t)x),g(t
)=f(t
y+(1−t
)x)g′(t
)=▽fT(t
y+(1−t
)x)(y−x)⇒g(t)≥g(t
)+g′(t
)(t−t
)由定义2可知,f为凸函数
4、凸函数的定义4:二阶条件
若 f : R n → R f:R^n \rightarrow R f:Rn→R二阶可微,则 f f f为凸函数 ⇔ d o m f \Leftrightarrow dom \space f ⇔dom f为凸, ▽ 2 f ( x ) ⪰ 0 , ∀ x ∈ d o m f \triangledown^2 f(x) \succeq 0,\forall \space x \in dom \space f ▽2f(x)⪰0,∀ x∈dom f
此处需要知道,关于二阶条件与严格凸的关系:
▽
2
f
(
x
)
≻
0
⇒
严
格
凸
严
格
凸
⇏
▽
2
f
(
x
)
≻
0
\triangledown^2 f(x) \succ 0 \Rightarrow 严格凸\\ 严格凸 \nRightarrow \triangledown^2 f(x) \succ 0
▽2f(x)≻0⇒严格凸严格凸⇏▽2f(x)≻0
Ex1:二次函数
f
:
R
n
→
R
,
d
o
m
f
=
R
n
f
(
x
)
=
1
2
x
T
P
x
+
q
T
x
+
r
,
P
∈
S
n
,
q
∈
R
n
,
r
∈
R
▽
2
f
(
x
)
=
P
f:R^n \rightarrow R,dom \space f=R^n\\ f(x)=\frac{1}{2}x^TPx+q^Tx+r,P\in S^n,q\in R^n,r\in R\\ \triangledown^2f(x)=P
f:Rn→R,dom f=Rnf(x)=21xTPx+qTx+r,P∈Sn,q∈Rn,r∈R▽2f(x)=P
二次函数
▽
2
f
(
x
)
≻
0
⇔
严
格
凸
\triangledown^2f(x) \succ 0 \Leftrightarrow 严格凸
▽2f(x)≻0⇔严格凸
Ex2:
f
(
x
)
=
1
x
2
,
x
≠
0
,
x
∈
R
f
′
′
(
x
)
=
6
x
−
4
f
(
x
)
虽
正
定
,
但
f
(
x
)
不
是
凸
函
数
,
因
为
d
o
m
f
不
是
凸
集
f(x)=\frac{1}{x^2},x \neq 0,x \in R\\ f''(x)=6x^{-4}\\ f(x)虽正定,但f(x)不是凸函数,因为dom \space f不是凸集
f(x)=x21,x=0,x∈Rf′′(x)=6x−4f(x)虽正定,但f(x)不是凸函数,因为dom f不是凸集
Ex3:仿射函数
f ( x ) = A x + b , ▽ 2 f ( x ) = 0 ⇒ f(x)=Ax+b,{\triangledown}^2f(x)=0 \Rightarrow f(x)=Ax+b,▽2f(x)=0⇒凸函数
Ex4:指数函数
f ( x ) = e a x , x ∈ R , ▽ 2 f ( x ) = a 2 e a x ⇒ f(x)=e^{ax},x\in R, \triangledown^2f(x)=a^2e^{ax}\Rightarrow f(x)=eax,x∈R,▽2f(x)=a2eax⇒凸函数
Ex5:幂函数
f
(
x
)
=
x
a
,
x
∈
R
+
+
,
f
′
′
(
x
)
=
a
(
a
−
1
)
x
a
−
2
▽
2
f
(
x
)
=
{
≥
0
,
a
≥
1
o
r
a
≤
0
≤
0
,
0
≤
a
≤
1
f(x)=x^a,x\in R_{++},f''(x)=a(a-1)x^{a-2}\\ \triangledown^2f(x)=\left\{ \begin{matrix} \geq 0,a \geq 1 \space or \space a \leq 0\\ \leq 0,0 \leq a \leq 1 \end{matrix} \right.
f(x)=xa,x∈R++,f′′(x)=a(a−1)xa−2▽2f(x)={≥0,a≥1 or a≤0≤0,0≤a≤1
Ex6:绝对值幂函数
f
(
x
)
=
∣
x
∣
P
,
x
∈
R
P
较
为
合
适
时
:
f
′
(
x
)
=
{
P
x
P
−
1
,
x
≥
0
−
P
(
−
x
)
P
−
1
,
x
<
0
f
′
′
(
x
)
=
{
P
(
P
−
1
)
x
P
−
2
,
x
≥
0
P
(
P
−
1
)
x
P
−
2
,
x
<
0
P
>
1
时
,
函
数
为
凸
P
=
1
时
,
∣
x
∣
不
可
导
,
但
是
仍
为
凸
f(x)=|x|^P,x \in R\\ P较为合适时:f'(x)=\left\{ \begin{matrix} Px^{P-1},x \geq 0\\ -P(-x)^{P-1},x<0 \end{matrix} \right.\\ f''(x)=\left\{ \begin{matrix} P(P-1)x^{P-2},x \geq 0\\ P(P-1)x^{P-2},x<0 \end{matrix} \right.\\ P>1时,函数为凸\\ P=1时,|x|不可导,但是仍为凸
f(x)=∣x∣P,x∈RP较为合适时:f′(x)={PxP−1,x≥0−P(−x)P−1,x<0f′′(x)={P(P−1)xP−2,x≥0P(P−1)xP−2,x<0P>1时,函数为凸P=1时,∣x∣不可导,但是仍为凸
故
P
≥
1
P\geq 1
P≥1时,绝对值幂函数为凸
Ex7:对数函数
f
(
x
)
=
log
(
x
)
,
x
∈
R
+
+
f
′
(
x
)
=
1
x
,
f
′
′
(
x
)
=
−
1
x
2
<
0
f(x)=\log(x),x\in R_{++}\\ f'(x)=\frac{1}{x},f''(x)=-\frac{1}{x^2}<0
f(x)=log(x),x∈R++f′(x)=x1,f′′(x)=−x21<0
严格凹函数
Ex8:负熵
f
(
x
)
=
x
log
(
x
)
,
x
∈
R
+
+
f
′
(
x
)
=
1
+
log
(
x
)
,
f
′
′
(
x
)
=
1
x
>
0
f(x)=x\log(x),x\in R_{++}\\ f'(x)=1+\log(x),f''(x)=\frac{1}{x}>0
f(x)=xlog(x),x∈R++f′(x)=1+log(x),f′′(x)=x1>0
严格凸函数
Ex9:范数
R n R^n Rn空间范数 P ( x ) , x ∈ R n P(x),x\in R^n P(x),x∈Rn,范数定义 { P ( x ) ≥ 0 a n d P ( x ) = 0 ⇔ x = 0 P ( a x ) = ∣ a ∣ P ( x ) P ( x + y ) ≤ P ( x ) + P ( y ) \left\{ \begin{matrix} P(x) \geq 0 \space and \space P(x)=0 \Leftrightarrow x=0\\ P(ax)=|a|P(x)\\P(x+y) \leq P(x)+P(y)\end{matrix} \right. ⎩⎨⎧P(x)≥0 and P(x)=0⇔x=0P(ax)=∣a∣P(x)P(x+y)≤P(x)+P(y)
∀
x
,
y
∈
R
n
,
∀
0
≤
θ
≤
1
P
(
θ
x
+
(
1
−
θ
)
y
)
≤
P
(
θ
x
)
+
P
(
(
1
−
θ
)
y
)
=
θ
P
(
x
)
+
(
1
−
θ
)
P
(
y
)
\forall \space x,y \in R^n,\forall \space 0 \leq \theta \leq 1\\ P(\theta x+(1-\theta)y) \leq P(\theta x)+P((1-\theta)y)=\theta P(x)+(1-\theta)P(y)\\
∀ x,y∈Rn,∀ 0≤θ≤1P(θx+(1−θ)y)≤P(θx)+P((1−θ)y)=θP(x)+(1−θ)P(y)
一定是凸函数
Ex10:零范数(不是范数)
∣ ∣ x ∣ ∣ 0 = ||x||_0= ∣∣x∣∣0=非0元素的数目,不是凸函数
Ex11:极大值函数
f
(
x
)
=
m
a
x
{
x
1
,
⋯
,
x
n
}
,
x
∈
R
n
∀
x
,
y
∈
R
n
,
0
≤
θ
≤
1
f
(
θ
x
+
(
1
−
θ
)
y
)
=
m
a
x
{
θ
x
i
+
(
1
−
θ
)
y
i
}
,
i
=
1
,
⋯
,
n
≤
θ
m
a
x
{
x
1
}
+
(
1
−
θ
)
m
a
x
{
y
i
}
,
i
=
1
,
⋯
,
n
=
θ
f
(
x
)
+
(
1
−
θ
)
f
(
y
)
f(x)=max\{x_1,\cdots,x_n\},x \in R^n\\ \forall \space x,y \in R^n,0 \leq \theta \leq 1\\ f(\theta x+(1-\theta)y)=max\{\theta x_i+(1-\theta)y_i\},i=1,\cdots,n\\ \leq \theta max\{x_1\}+(1-\theta)max\{y_i\},i=1,\cdots,n\\ =\theta f(x)+(1-\theta)f(y)
f(x)=max{x1,⋯,xn},x∈Rn∀ x,y∈Rn,0≤θ≤1f(θx+(1−θ)y)=max{θxi+(1−θ)yi},i=1,⋯,n≤θmax{x1}+(1−θ)max{yi},i=1,⋯,n=θf(x)+(1−θ)f(y)
为凸函数
Ex12:
l
o
g
−
s
u
m
−
u
p
log-sum-up
log−sum−up函数,解析逼近
f
(
x
)
=
log
(
e
x
1
+
⋯
+
e
x
n
)
,
x
∈
R
n
m
a
x
{
x
1
,
⋯
,
x
n
}
≤
f
(
x
)
≤
m
a
x
{
x
1
,
⋯
,
x
n
}
+
log
n
∂
f
∂
x
i
=
e
x
i
e
x
1
+
⋯
+
e
x
n
i
≠
j
,
∂
2
f
∂
x
i
∂
x
j
=
−
e
x
i
e
x
j
(
e
x
1
+
⋯
+
e
x
n
)
2
i
=
j
,
∂
2
f
∂
x
i
∂
x
j
=
−
e
x
i
e
x
i
+
e
x
i
(
e
x
1
+
⋯
+
e
x
n
)
(
e
x
1
+
⋯
+
e
x
n
)
2
L
e
t
z
=
[
e
x
1
,
⋯
,
e
x
n
]
T
H
=
1
(
1
T
z
)
2
{
[
e
x
1
(
e
x
1
+
⋯
+
e
x
n
)
⋯
0
⋮
⋱
⋮
0
⋯
e
x
1
(
e
x
1
+
⋯
+
e
x
n
)
]
−
[
e
x
1
⋮
e
x
n
]
[
e
x
1
⋯
e
x
n
]
}
=
1
1
T
z
(
(
1
T
z
)
d
i
a
g
{
z
}
−
z
z
T
)
=
1
1
T
z
k
∀
v
∈
R
n
,
v
T
k
v
≥
0
v
T
k
v
=
(
1
T
z
)
v
T
d
i
a
g
{
z
}
v
−
v
T
z
z
T
v
=
(
∑
i
z
i
)
(
∑
i
v
i
2
z
i
)
−
(
∑
i
v
i
z
i
)
2
a
i
=
v
i
z
i
,
b
i
=
z
i
=
(
b
T
b
)
(
a
T
a
)
−
(
a
T
b
)
2
≥
0
(
C
a
u
c
h
y
−
S
c
h
w
a
r
t
s
不
等
式
)
得
证
f(x)=\log(e^{x_1}+\cdots+e^{x_n}),x \in R^n\\ max\{x_1,\cdots,x_n\} \leq f(x) \leq max\{x_1,\cdots,x_n\}+\log n\\ \frac{\partial{f}}{\partial{x_i}}=\frac{e^{x_i}}{e^{x_1}+\cdots+e^{x_n}}\\ i \neq j, \frac{\partial^2{f}}{\partial{x_i}\partial{x_j}}=\frac{-e^{x_i}e^{x_j}}{(e^{x_1}+\cdots+e^{x_n})^2}\\ i=j,\frac{\partial^2{f}}{\partial{x_i}\partial{x_j}}=\frac{-e^{x_i}e^{x_i}+e^{x_i}(e^{x_1}+\cdots+e^{x_n})}{(e^{x_1}+\cdots+e^{x_n})^2}\\ Let \space\space z=[e^{x_1},\cdots,e^{x_n}]^T\\ H=\frac{1}{(1^Tz)^2}\{\left[ \begin{matrix} e^{x_1}(e^{x_1}+\cdots+e^{x_n}) & \cdots & 0 \\ \vdots & \ddots & \vdots\\0 & \cdots & e^{x_1}(e^{x_1}+\cdots+e^{x_n}) \end{matrix} \right]-\left[ \begin{matrix} e^{x_1} \\ \vdots \\ e^{x_n} \end{matrix} \right]{\left[ \begin{matrix} e^{x_1} \cdots e^{x_n} \end{matrix} \right]}\}\\ =\frac{1}{1^Tz}((1^Tz)diag\{z\}-zz^T)\\ =\frac{1}{1^Tz} k\\ \forall \space v \in R^n,v^Tkv \geq 0\\ v^Tkv=(1^Tz)v^Tdiag\{z\}v-v^Tzz^Tv\\ =(\sum_i z_i)(\sum_i v^2_iz_i)-(\sum_i v_iz_i)^2\\ a_i=v_i \sqrt{z_i},b_i=\sqrt{z_i}\\ =(b^Tb)(a^Ta)-(a^Tb)^2 \geq 0(Cauchy-Schwarts不等式)得证
f(x)=log(ex1+⋯+exn),x∈Rnmax{x1,⋯,xn}≤f(x)≤max{x1,⋯,xn}+logn∂xi∂f=ex1+⋯+exnexii=j,∂xi∂xj∂2f=(ex1+⋯+exn)2−exiexji=j,∂xi∂xj∂2f=(ex1+⋯+exn)2−exiexi+exi(ex1+⋯+exn)Let z=[ex1,⋯,exn]TH=(1Tz)21{⎣⎢⎡ex1(ex1+⋯+exn)⋮0⋯⋱⋯0⋮ex1(ex1+⋯+exn)⎦⎥⎤−⎣⎢⎡ex1⋮exn⎦⎥⎤[ex1⋯exn]}=1Tz1((1Tz)diag{z}−zzT)=1Tz1k∀ v∈Rn,vTkv≥0vTkv=(1Tz)vTdiag{z}v−vTzzTv=(i∑zi)(i∑vi2zi)−(i∑vizi)2ai=vizi,bi=zi=(bTb)(aTa)−(aTb)2≥0(Cauchy−Schwarts不等式)得证
Ex13:几何平均
f ( x ) = ( x 1 ⋯ x n ) 1 n , x ∈ R + + n f(x)=(x_1 \cdots x_n)^{\frac{1}{n}},x \in R^n_{++} f(x)=(x1⋯xn)n1,x∈R++n,是凹函数
Ex14:行列式对数
f
(
x
)
=
log
d
e
t
(
x
)
,
d
o
m
f
=
S
+
+
n
n
=
1
时
,
凹
函
数
n
>
1
时
,
∀
z
∈
S
+
+
n
,
∀
t
∈
R
,
v
∈
S
n
z
+
t
v
∈
S
+
+
n
g
(
t
)
=
f
(
z
+
t
v
)
=
log
d
e
t
(
z
+
t
v
)
=
log
d
e
t
{
z
1
2
(
I
+
t
z
−
1
2
v
z
−
1
2
)
z
1
2
}
=
log
d
e
t
(
z
)
+
∑
i
=
1
n
log
(
1
+
t
λ
i
)
f(x)=\log det(x),dom \space f=S^n_{++}\\ n=1时,凹函数\\ n>1时,\forall \space z \in S^n_{++},\forall \space t \in R,v \in S^n\\ z+tv \in S^n_{++}\\ g(t)=f(z+tv)=\log det(z+tv)\\ =\log det\{z^\frac{1}{2}(I+tz^{-\frac{1}{2}}vz^{-\frac{1}{2}})z^\frac{1}{2}\}\\ =\log det(z)+\sum^n_{i=1} \log(1+t\lambda_i)
f(x)=logdet(x),dom f=S++nn=1时,凹函数n>1时,∀ z∈S++n,∀ t∈R,v∈Snz+tv∈S++ng(t)=f(z+tv)=logdet(z+tv)=logdet{z21(I+tz−21vz−21)z21}=logdet(z)+i=1∑nlog(1+tλi)
其中:
λ
i
:
z
−
1
2
v
z
−
1
2
\lambda_i:z^{-\frac{1}{2}}vz^{-\frac{1}{2}}
λi:z−21vz−21的第
i
i
i个特征值,
z
−
1
2
v
z
−
1
2
z^{-\frac{1}{2}}vz^{-\frac{1}{2}}
z−21vz−21是对称矩阵,可以分解成
Q
Λ
Q
T
Q \varLambda Q^T
QΛQT,其中
Q
Q
T
=
I
,
d
e
t
Q
=
d
e
t
Q
T
=
1
QQ^T=I,detQ=detQ^T=1
QQT=I,detQ=detQT=1
d
e
t
(
I
+
t
z
−
1
2
v
z
−
1
2
)
=
d
e
t
(
Q
Q
T
+
Q
t
Λ
Q
T
)
=
d
e
t
Q
⋅
d
e
t
(
I
+
t
Λ
)
⋅
d
e
t
Q
T
=
d
e
t
(
I
+
t
Λ
)
=
Π
i
=
1
n
(
1
+
t
λ
i
)
det(I+tz^{-\frac{1}{2}}vz^{-\frac{1}{2}})=det(QQ^T+Qt\varLambda Q^T)\\ =detQ \cdot det(I+t \varLambda) \cdot detQ^T\\ =det(I+t\varLambda)=\Pi_{i=1}^n(1+t\lambda_i)
det(I+tz−21vz−21)=det(QQT+QtΛQT)=detQ⋅det(I+tΛ)⋅detQT=det(I+tΛ)=Πi=1n(1+tλi)
g ′ ( t ) = ∑ i λ i 1 + t λ i g ′ ′ ( t ) = ∑ i − λ i 2 ( 1 + t λ i ) 2 ≤ 0 g'(t)=\sum_i \frac{\lambda_i}{1+t\lambda_i}\\ g''(t)=\sum_i \frac{-\lambda^2_i}{(1+t\lambda_i)^2} \leq 0 g′(t)=i∑1+tλiλig′′(t)=i∑(1+tλi)2−λi2≤0
g ( t ) g(t) g(t)为凹函数,故 f f f为凹函数