此條目需要
精通或熟悉相关主题的编者 参与及协助编辑。
(2019年3月5日 ) 請邀請 適合的人士改善本条目 。更多的細節與詳情請參见討論頁 。
在数学 中,矩阵微积分 是多元微积分 的一种特殊表达,尤其是在矩阵 空间上进行讨论的时候。它把单个函数对多个变量或者多元函数对单个变量的偏导数 写成向量和矩阵的形式,使其可以被当成一个整体被处理。這使得要在多元函數尋找最大或最小值,又或是要為微分方程 系統尋解的過程大幅簡化。这里我们主要使用统计学 和工程学 中的惯用记法,而张量下标记法 更常用于物理学 中。
本条目中,我们使用单个字母变量来表示多个变量的集合体(向量和矩阵),这样可以充分利用矩阵记法 的效用。
本条目使用不同字体来区分标量 、向量 和矩阵。下面使用M (n ,m )来表示包含n 行m 列的n×m 实 矩阵的空间,它等同于
R
n
×
m
{\displaystyle \mathbb {R} ^{n\times m}}
。该空间中的一般矩阵用粗体大写字母表示,例如
A
{\displaystyle \mathbf {A} }
,
X
{\displaystyle \mathbf {X} }
,
Y
{\displaystyle \mathbf {Y} }
等。而若该矩阵属于M (n ,1),即列向量 ,则用粗体小写字母表示,如
a
{\displaystyle \mathbf {a} }
,
x
{\displaystyle \mathbf {x} }
,
y
{\displaystyle \mathbf {y} }
等。特别地,M (1,1)中的元素为标量,用小写斜体字母表示,如a ,t ,x 等。
X
T
{\displaystyle \mathbf {X} ^{\mathrm {T} }}
表示矩阵转置 ,tr(
X
{\displaystyle \mathbf {X} }
)表示矩阵的迹 ,而
det
(
X
)
{\displaystyle \det(\mathbf {X} )}
或
|
X
|
{\displaystyle |\mathbf {X} |}
表示行列式 。除非专门注明,所有函数都默认属于光滑函数 C 1 。 通常字母表前半部分的字母(a, b, c, …)用于表示常量,而后半部分的字母(t, x, y, …)用于表示变量。
向量的内积(点积 )在诸多领域中有着广泛的运用。
定义在
R
n
{\displaystyle \mathbb {R} ^{n}}
上的向量
a
=
[
a
1
,
a
2
,
⋯
,
a
n
]
T
{\displaystyle \mathbf {a} =[a_{1},a_{2},\cdots ,a_{n}]^{T}}
和
b
=
[
b
1
,
b
2
,
⋯
,
b
n
]
T
{\displaystyle \mathbf {b} =[b_{1},b_{2},\cdots ,b_{n}]^{T}}
的点积定义为:
⟨
a
,
b
⟩
:=
a
⋅
b
=
a
T
b
=
b
T
a
=
∑
i
=
1
n
a
i
b
i
=
a
1
b
1
+
a
2
b
2
+
⋯
+
a
n
b
n
{\displaystyle \langle \mathbf {a} ,\mathbf {b} \rangle :=\mathbf {a} \cdot \mathbf {b} =\mathbf {a} ^{\mathrm {T} }\mathbf {b} =\mathbf {b} ^{\mathrm {T} }\mathbf {a} =\sum _{i=1}^{n}a_{i}b_{i}=a_{1}b_{1}+a_{2}b_{2}+\cdots +a_{n}b_{n}}
。
和向量类似,矩阵也可以定义内积(弗罗比尼乌斯内积 ):对于定义在
R
m
×
n
{\displaystyle \mathbb {R} ^{m\times n}}
上的实矩阵
A
{\displaystyle \mathbf {A} }
和
B
{\displaystyle \mathbf {B} }
,
⟨
A
,
B
⟩
:=
A
:
B
=
∑
i
=
1
m
∑
j
=
1
n
A
i
j
B
i
j
=
t
r
(
B
T
A
)
=
t
r
(
A
B
T
)
=
t
r
(
A
T
B
)
=
t
r
(
B
A
T
)
{\displaystyle \langle \mathbf {A} ,\mathbf {B} \rangle :=\mathbf {A} :\mathbf {B} =\sum _{i=1}^{m}\sum _{j=1}^{n}A_{ij}B_{ij}=\mathrm {tr} (\mathbf {B} ^{\mathrm {T} }\mathbf {A} )=\mathrm {tr} (\mathbf {A} \mathbf {B} ^{\mathrm {T} })=\mathrm {tr} (\mathbf {A} ^{\mathrm {T} }\mathbf {B} )=\mathrm {tr} (\mathbf {B} \mathbf {A} ^{\mathrm {T} })}
。
利用内积,可以定义向量和矩阵的范数 (模)。
向量可以以多种形式定义范数。欧几里得范数是
R
n
{\displaystyle \mathbb {R} ^{n}}
上最常用的范数。它可以以向量与其自身的内积 的平方根 表示:
‖
a
‖
:=
⟨
a
,
a
⟩
=
∑
i
=
1
n
a
i
2
=
a
1
2
+
a
2
2
+
⋯
+
a
n
2
{\displaystyle \|\mathbf {a} \|:={\sqrt {\langle \mathbf {a} ,\mathbf {a} \rangle }}={\sqrt {\sum _{i=1}^{n}a_{i}^{2}}}={\sqrt {a_{1}^{2}+a_{2}^{2}+\cdots +a_{n}^{2}}}}
。
而矩阵范数 也有多种定义,数值线性代数 中最常用的一种范数为弗罗贝尼乌斯范数,它是矩阵与其自身的弗罗比尼乌斯内积的平方根:对于定义在
R
m
×
n
{\displaystyle \mathbb {R} ^{m\times n}}
上的实矩阵
A
{\displaystyle \mathbf {A} }
,
‖
A
‖
:=
⟨
A
,
A
⟩
=
∑
i
=
1
m
∑
j
=
1
n
A
i
j
2
=
t
r
(
A
T
A
)
=
t
r
(
A
A
T
)
{\displaystyle \|\mathbf {A} \|:={\sqrt {\langle \mathbf {A} ,\mathbf {A} \rangle }}={\sqrt {\sum _{i=1}^{m}\sum _{j=1}^{n}A_{ij}^{2}}}={\sqrt {\mathrm {tr} (\mathbf {A} ^{\mathrm {T} }\mathbf {A} )}}={\sqrt {\mathrm {tr} (\mathbf {A} \mathbf {A} ^{\mathrm {T} })}}}
。
对于复向量和复矩阵,将转置改为共轭转置即可。
线性映射 指的是满足保持向量空间 中向量加法和数乘运算的映射。此处的“向量”是抽象代数意义上的。也就是说,从向量空间
V
{\displaystyle V}
到
W
{\displaystyle W}
(二者的系数体均为
K
{\displaystyle K}
)的映射
L
:
V
→
W
{\displaystyle {\mathcal {L}}:V\to W}
要想成为线性映射,必须满足齐次性和叠加性:
齐次性:对于任何向量
x
∈
V
{\displaystyle \mathbf {x} \in V}
和任何标量
a
∈
K
{\displaystyle a\in K}
:
L
(
a
x
)
=
a
L
(
x
)
{\displaystyle {\mathcal {L}}(a\mathbf {x} )=a{\mathcal {L}}(\mathbf {x} )}
叠加性:对于任意两个
V
{\displaystyle V}
中的向量
x
{\displaystyle \mathbf {x} }
和
y
{\displaystyle \mathbf {y} }
:
L
(
x
+
y
)
=
L
(
x
)
+
L
(
y
)
{\displaystyle {\mathcal {L}}(\mathbf {x} +\mathbf {y} )={\mathcal {L}}(\mathbf {x} )+{\mathcal {L}}(\mathbf {y} )}
对于实列向量(即一般意义上的实向量),将上述表述中的
V
{\displaystyle V}
、
W
{\displaystyle W}
和
K
{\displaystyle K}
改为
R
m
{\displaystyle \mathbb {R} ^{m}}
、
R
n
{\displaystyle \mathbb {R} ^{n}}
和
R
{\displaystyle \mathbb {R} }
即可。可以知道这种线性映射可以通过n×m 实矩阵矩阵左乘向量得到。
对于实矩阵,将上述表述中的
V
{\displaystyle V}
、
W
{\displaystyle W}
和
K
{\displaystyle K}
改为
R
m
×
n
{\displaystyle \mathbb {R} ^{m\times n}}
、
R
p
×
q
{\displaystyle \mathbb {R} ^{p\times q}}
和
R
{\displaystyle \mathbb {R} }
即可。
特别地,对于实标量,线性映射指的就是正比例函数。
对于向量和矩阵,可以使用类似于标量的极限定义方式来定义它们的极限。
标量序列的极限的现代定义如下:
对于标量序列
{
a
n
}
{\displaystyle \{a_{n}\}}
,当
∀
ϵ
>
0
,
∃
N
>
0
,
{\displaystyle \forall \epsilon >0,\exists N>0,}
使得
∀
n
>
N
,
{\displaystyle \forall n>N,}
都有
|
a
n
−
A
|
<
ϵ
{\displaystyle |a_{n}-A|<\epsilon }
时,称其在
n
→
∞
{\displaystyle n\to \infty }
时的极限为A 。记作
lim
n
→
∞
a
n
=
A
{\displaystyle \lim _{n\to \infty }a_{n}=A}
。
对于向量或矩阵序列也有类似的定义。
标量函数的极限的现代定义如下:
对于标量函数
f
(
x
)
{\displaystyle f(x)}
,当
∀
ϵ
>
0
,
∃
δ
>
0
,
{\displaystyle \forall \epsilon >0,\exists \delta >0,}
使得
∀
x
∈
{
x
∈
R
|
0
<
|
x
−
x
0
|
<
δ
}
,
{\displaystyle \forall x\in \{x\in \mathbb {R} |0<|x-x_{0}|<\delta \},}
都有
|
f
(
x
)
−
A
|
<
ϵ
{\displaystyle |f(x)-A|<\epsilon }
时,称其在
x
0
{\displaystyle x_{0}}
处的极限为A。记作
lim
x
→
x
0
f
(
x
)
=
A
{\displaystyle \lim _{x\to x_{0}}f(x)=A}
。
对于向量或矩阵函数也有类似的定义。
可以定义向量函数的连续:
类似于标量级数,我们规定矩阵序列
{
A
(
n
)
}
{\displaystyle \{\mathbf {A} ^{(n)}\}}
的无穷和
A
(
0
)
+
A
(
1
)
+
A
(
2
)
+
⋯
{\displaystyle \mathbf {A} ^{(0)}+\mathbf {A} ^{(1)}+\mathbf {A} ^{(2)}+\cdots }
为矩阵的级数。记为
∑
k
=
0
∞
A
(
k
)
{\displaystyle \sum _{k=0}^{\infty }\mathbf {A} ^{(k)}}
。它是部分和序列
S
(
n
)
=
∑
k
=
0
n
A
(
k
)
{\displaystyle \mathbf {S} ^{(n)}=\sum _{k=0}^{n}\mathbf {A} ^{(k)}}
在
n
→
∞
{\displaystyle n\to \infty }
时的极限。如果这个极限收敛,称这个矩阵级数收敛,反之称为矩阵级数发散。
如果所有矩阵的各个位置的元素的级数和都是绝对收敛的,称这个矩阵绝对收敛。可以证明这与矩阵范数的级数和收敛等价。
绝对收敛的矩阵级数一定收敛,并且可以 交换求和次序并且不影响结果。
对于矩阵也可以定义幂级数。规定对于方阵序列
{
A
k
}
{\displaystyle \{\mathbf {A} ^{k}\}}
以及复数序列
c
k
{\displaystyle c_{k}}
,无穷和
∑
k
=
0
∞
c
k
A
k
=
c
0
A
0
+
c
1
A
1
+
c
2
A
2
+
⋯
{\displaystyle \sum _{k=0}^{\infty }c_{k}\mathbf {A} ^{k}=c_{0}\mathbf {A} ^{0}+c_{1}\mathbf {A} ^{1}+c_{2}\mathbf {A} ^{2}+\cdots }
为矩阵的幂级数。
可以利用方阵的幂级数定义方阵的初等函数。
下面是常见的方阵函数。
e
A
=
∑
k
=
0
∞
A
k
k
!
=
E
+
A
1
!
+
A
2
2
!
+
A
3
3
!
+
⋯
+
A
k
k
!
+
⋯
{\displaystyle e^{\mathbf {A} }=\sum _{k=0}^{\infty }{\frac {\mathbf {A} ^{k}}{k!}}=\mathbf {E} +{\frac {\mathbf {A} }{1!}}+{\frac {\mathbf {A} ^{2}}{2!}}+{\frac {\mathbf {A} ^{3}}{3!}}+\cdots +{\frac {\mathbf {A} ^{k}}{k!}}+\cdots }
sin
A
=
∑
k
=
0
∞
(
−
1
)
k
A
2
k
+
1
(
2
k
+
1
)
!
=
A
1
!
−
A
3
3
!
+
A
5
5
!
+
⋯
+
(
−
1
)
k
A
2
k
+
1
(
2
k
+
1
)
!
+
⋯
{\displaystyle \sin \mathbf {A} =\sum _{k=0}^{\infty }(-1)^{k}{\frac {\mathbf {A} ^{2k+1}}{(2k+1)!}}={\frac {\mathbf {A} }{1!}}-{\frac {\mathbf {A} ^{3}}{3!}}+{\frac {\mathbf {A} ^{5}}{5!}}+\cdots +(-1)^{k}{\frac {\mathbf {A} ^{2k+1}}{(2k+1)!}}+\cdots }
cos
A
=
∑
k
=
0
∞
(
−
1
)
k
A
2
k
(
2
k
)
!
=
E
−
A
2
2
!
+
A
4
4
!
+
⋯
+
(
−
1
)
k
A
2
k
(
2
k
)
!
+
⋯
{\displaystyle \cos \mathbf {A} =\sum _{k=0}^{\infty }(-1)^{k}{\frac {\mathbf {A} ^{2k}}{(2k)!}}=\mathbf {E} -{\frac {\mathbf {A} ^{2}}{2!}}+{\frac {\mathbf {A} ^{4}}{4!}}+\cdots +(-1)^{k}{\frac {\mathbf {A} ^{2k}}{(2k)!}}+\cdots }
由于向量可看成仅有一列的矩阵,最简单的矩阵求导为向量求导。
这里的标记方法可以通过如下方式表达大部分向量微积分 :把n 维向量构成的空间M (n ,1)等同为欧氏空间
R
n
{\displaystyle \mathbb {R} ^{n}}
, 标量M (1,1)等同于
R
{\displaystyle \mathbb {R} }
。对应的向量微积分的概念在每小节末尾列出。
首先定义向量函数的微分 :
有如下的定理:
定理 — 当
f
(
x
)
{\displaystyle \mathbf {f} (\mathbf {x} )}
在
x
0
{\displaystyle \mathbf {x} _{0}}
处可微时,其在该点处连续。反之则不然。
我们将向量函数
f
(
x
)
{\displaystyle \mathbf {f} (\mathbf {x} )}
的第i 个分量在
x
0
{\displaystyle \mathbf {x} _{0}}
处对自变量向量的第j 个分量的偏导数定义为
lim
t
→
0
f
i
(
x
0
+
t
e
j
)
−
f
i
(
x
0
)
t
{\displaystyle \lim _{t\to 0}{\frac {f_{i}(\mathbf {x} _{0}+t\mathbf {e} _{j})-f_{i}(\mathbf {x} _{0})}{t}}}
,其中
e
j
{\displaystyle \mathbf {e} _{j}}
是第j 个单位向量。记作
D
j
f
i
{\displaystyle \operatorname {D} _{j}f_{i}}
。
定理 — 当
f
(
x
)
{\displaystyle \mathbf {f} (\mathbf {x} )}
在
x
0
{\displaystyle \mathbf {x} _{0}}
处可微时,其各分量在该点处关于自变量各分量的偏导数存在。
我们把矩阵
D
f
{\displaystyle \operatorname {D} \mathbf {f} }
叫做向量函数的导数。也记作
d
f
d
x
{\displaystyle {\frac {\operatorname {d} \mathbf {f} }{\operatorname {d} \mathbf {x} }}}
。注意这里使用的是分子布局记法。
这里的“分子布局记法”一般指,在表示导数向量(或矩阵)时,该导数的行数等于导数表达式中处于分子部分的参数维度;若采用分母布局记法,则导数的行数等于导数表达式中处于分母部分的参数维度。分子布局记法的结果与分母布局记法的结果互为转置关系。
标量可以视作一个1维向量。所以采用分子布局记法时,m 维向量向量对标量求导的结果是一个m ×1的矩阵,也就是m 维列向量。
向量
y
=
[
y
1
y
2
⋯
y
m
]
T
{\displaystyle \mathbf {y} ={\begin{bmatrix}y_{1}&y_{2}&\cdots &y_{m}\end{bmatrix}}^{\mathsf {T}}}
关于标量x 的导数可以(用分子记法 )写成
d
y
d
x
=
[
d
y
1
d
x
d
y
2
d
x
⋮
d
y
m
d
x
]
{\displaystyle {\frac {\operatorname {d} \mathbf {y} }{\operatorname {d} x}}={\begin{bmatrix}{\frac {\operatorname {d} y_{1}}{\operatorname {d} x}}\\{\frac {\operatorname {d} y_{2}}{\operatorname {d} x}}\\\vdots \\{\frac {\operatorname {d} y_{m}}{\operatorname {d} x}}\\\end{bmatrix}}}
在向量微积分 中,向量
y
{\displaystyle \mathbf {y} }
关于标量
x
{\displaystyle x}
的导数也被称为向量
y
{\displaystyle \mathbf {y} }
的切向量 ,
d
y
d
x
{\displaystyle {\frac {\operatorname {d} \mathbf {y} }{\operatorname {d} x}}}
。注意这里
y
:
R
→
R
n
{\displaystyle \mathbf {y} :\mathbb {R} \rightarrow \mathbb {R} ^{n}}
。
可以看到向量对标量求导就是其各个分量分别对标量求导。
有
d
y
=
d
y
d
x
d
x
{\displaystyle \operatorname {d} \mathbf {y} ={\frac {\operatorname {d} \mathbf {y} }{\operatorname {d} x}}\operatorname {d} x}
例子 简单的样例包括欧式空间 中的速度 向量,它是位移 向量(看作关于时间的函数)的切向量 。更进一步而言, 加速度 是速度的切向量。
标量 y 对向量
x
=
[
x
1
x
2
⋯
x
n
]
T
{\displaystyle \mathbf {x} ={\begin{bmatrix}x_{1}&x_{2}&\cdots &x_{n}\end{bmatrix}}^{\mathsf {T}}}
的导数可以(用分子记法 )写成
d
y
d
x
=
[
∂
y
∂
x
1
∂
y
∂
x
2
⋯
∂
y
∂
x
n
]
{\displaystyle {\frac {\operatorname {d} y}{\operatorname {d} \mathbf {x} }}={\begin{bmatrix}{\frac {\partial y}{\partial x_{1}}}&{\frac {\partial y}{\partial x_{2}}}&\cdots &{\frac {\partial y}{\partial x_{n}}}\end{bmatrix}}}
有
d
y
=
d
y
d
x
d
x
=
∑
i
=
1
n
∂
y
∂
x
i
d
x
i
{\displaystyle \operatorname {d} y={\frac {\operatorname {d} y}{\operatorname {d} \mathbf {x} }}\operatorname {d} \mathbf {x} =\sum _{i=1}^{n}{\frac {\partial y}{\partial x_{i}}}\operatorname {d} x_{i}}
。
在向量微积分 中,标量y 在空间
R
n
{\displaystyle \mathbb {R} ^{n}}
(其独立坐标是x 的分量)中的梯度 是标量y 对向量
x
{\displaystyle \mathbf {x} }
的导数的转置。在物理学中,电场 是电势 的负梯度 向量。
标量函数
f
(
x
)
{\displaystyle f(\mathbf {x} )}
对空间向量
x
{\displaystyle \mathbf {x} }
在单位向量
u
{\displaystyle \mathbf {u} }
(在这里表示为列向量)方向上的方向导数 可以用梯度定义:
∇
u
f
(
x
)
=
∇
f
(
x
)
⋅
u
{\displaystyle \nabla _{\mathbf {u} }{f}(\mathbf {x} )=\nabla f(\mathbf {x} )\cdot \mathbf {u} }
使用刚才定义的标量对向量的导数的记法,我们可以把方向导数写作
∇
u
f
=
(
∂
f
∂
x
)
⊤
u
{\displaystyle \nabla _{\mathbf {u} }f=\left({\frac {\partial f}{\partial \mathbf {x} }}\right)^{\top }\mathbf {u} }
。
这类记法在证明乘法法则和链式法则的时候非常直观,因为它们与我们熟悉的标量导数 的形式较为相似。
前面两种情况可以看作是向量对向量求导在其中一个是一维向量情况下的特例。类似地我们将会发现有关矩阵的求导可被以一种类似的方式化归为向量求导。
向量函数 (分量为函数的向量)
y
=
[
y
1
y
2
⋯
y
m
]
T
{\displaystyle \mathbf {y} ={\begin{bmatrix}y_{1}&y_{2}&\cdots &y_{m}\end{bmatrix}}^{\mathsf {T}}}
对输入向量
x
=
[
x
1
x
2
⋯
x
n
]
T
{\displaystyle \mathbf {x} ={\begin{bmatrix}x_{1}&x_{2}&\cdots &x_{n}\end{bmatrix}}^{\mathsf {T}}}
的导数,可以(用分子记法 ) 写作
d
y
d
x
=
[
∂
y
1
∂
x
1
∂
y
1
∂
x
2
⋯
∂
y
1
∂
x
n
∂
y
2
∂
x
1
∂
y
2
∂
x
2
⋯
∂
y
2
∂
x
n
⋮
⋮
⋱
⋮
∂
y
m
∂
x
1
∂
y
m
∂
x
2
⋯
∂
y
m
∂
x
n
]
{\displaystyle {\frac {\operatorname {d} \mathbf {y} }{\operatorname {d} \mathbf {x} }}={\begin{bmatrix}{\frac {\partial y_{1}}{\partial x_{1}}}&{\frac {\partial y_{1}}{\partial x_{2}}}&\cdots &{\frac {\partial y_{1}}{\partial x_{n}}}\\{\frac {\partial y_{2}}{\partial x_{1}}}&{\frac {\partial y_{2}}{\partial x_{2}}}&\cdots &{\frac {\partial y_{2}}{\partial x_{n}}}\\\vdots &\vdots &\ddots &\vdots \\{\frac {\partial y_{m}}{\partial x_{1}}}&{\frac {\partial y_{m}}{\partial x_{2}}}&\cdots &{\frac {\partial y_{m}}{\partial x_{n}}}\\\end{bmatrix}}}
在向量微积分 中,向量函数
y
{\displaystyle \mathbf {y} }
对分量表示一个空间的向量
x
{\displaystyle \mathbf {x} }
的导数也被称为前推 ,或雅可比矩阵 。
向量函数
f
{\displaystyle \mathbf {f} }
对R n 空间中向量
v
{\displaystyle \mathbf {v} }
的前推为
d
f
(
v
)
=
d
f
d
v
d
v
{\displaystyle \operatorname {d} \mathbf {f} (\mathbf {v} )={\frac {\operatorname {d} \mathbf {f} }{\operatorname {d} \mathbf {v} }}\operatorname {d} \mathbf {v} }
有两种类型的矩阵求导可以被写成相同大小的矩阵:矩阵对标量求导和标量对矩阵求导。它们在解决应用数学的许多领域常见的最小化问题中十分有用。类比于向量求导,相应的概念有切矩阵 和梯度矩阵 。
矩阵函数
Y
{\displaystyle \mathbf {Y} }
对标量x 的导数被称为切矩阵 ,(用分子记法 )可写成:
d
Y
d
x
=
[
∂
y
11
∂
x
∂
y
12
∂
x
⋯
∂
y
1
n
∂
x
∂
y
21
∂
x
∂
y
22
∂
x
⋯
∂
y
2
n
∂
x
⋮
⋮
⋱
⋮
∂
y
m
1
∂
x
∂
y
m
2
∂
x
⋯
∂
y
m
n
∂
x
]
{\displaystyle {\frac {\operatorname {d} \mathbf {Y} }{\operatorname {d} x}}={\begin{bmatrix}{\frac {\partial y_{11}}{\partial x}}&{\frac {\partial y_{12}}{\partial x}}&\cdots &{\frac {\partial y_{1n}}{\partial x}}\\{\frac {\partial y_{21}}{\partial x}}&{\frac {\partial y_{22}}{\partial x}}&\cdots &{\frac {\partial y_{2n}}{\partial x}}\\\vdots &\vdots &\ddots &\vdots \\{\frac {\partial y_{m1}}{\partial x}}&{\frac {\partial y_{m2}}{\partial x}}&\cdots &{\frac {\partial y_{mn}}{\partial x}}\\\end{bmatrix}}}
定义在元素是独立变量的p ×q 矩阵
X
{\displaystyle \mathbf {X} }
上的标量函数y 对
X
{\displaystyle \mathbf {X} }
的导数可以(用分子记法 )写作
d
y
d
X
=
[
∂
y
∂
x
11
∂
y
∂
x
21
⋯
∂
y
∂
x
p
1
∂
y
∂
x
12
∂
y
∂
x
22
⋯
∂
y
∂
x
p
2
⋮
⋮
⋱
⋮
∂
y
∂
x
1
q
∂
y
∂
x
2
q
⋯
∂
y
∂
x
p
q
]
{\displaystyle {\frac {\operatorname {d} y}{\operatorname {d} \mathbf {X} }}={\begin{bmatrix}{\frac {\partial y}{\partial x_{11}}}&{\frac {\partial y}{\partial x_{21}}}&\cdots &{\frac {\partial y}{\partial x_{p1}}}\\{\frac {\partial y}{\partial x_{12}}}&{\frac {\partial y}{\partial x_{22}}}&\cdots &{\frac {\partial y}{\partial x_{p2}}}\\\vdots &\vdots &\ddots &\vdots \\{\frac {\partial y}{\partial x_{1q}}}&{\frac {\partial y}{\partial x_{2q}}}&\cdots &{\frac {\partial y}{\partial x_{pq}}}\\\end{bmatrix}}}
定义矩阵上的重要的标量函数包括矩阵的迹 和行列式 。
类比于向量微积分 ,这个导数常被写成如下形式:
∇
X
y
(
X
)
=
∂
y
(
X
)
∂
X
{\displaystyle \nabla _{\mathbf {X} }y(\mathbf {X} )={\frac {\partial y(\mathbf {X} )}{\partial \mathbf {X} }}}
类似地,标量函数f (X )关于矩阵X 在方向Y 的方向导数 可写成
∇
Y
f
=
tr
(
∂
f
∂
X
Y
)
{\displaystyle \nabla _{\mathbf {Y} }f=\operatorname {tr} \left({\frac {\partial f}{\partial \mathbf {X} }}\mathbf {Y} \right)}
梯度矩阵经常被应用在估计理论 的最小化问题中,比如卡尔曼滤波 算法的推导 ,因此在这些领域中有着重要的地位。
考虑定义于
R
n
{\displaystyle \mathbb {R} ^{n}}
的子集
S
{\displaystyle S}
的向量函数
f
(
x
)
:
S
→
R
m
{\displaystyle \mathbf {f} (\mathbf {x} ):S\to \mathbb {R} ^{m}}
,设向量函数
f
(
x
)
{\displaystyle \mathbf {f} (\mathbf {x} )}
的第i 个分量为
f
i
(
x
)
{\displaystyle f_{i}(\mathbf {x} )}
,并假设其在S的内部点及其开邻域内有偏导数
D
j
f
i
{\displaystyle \operatorname {D} _{j}f_{i}}
。
考虑极限
lim
t
→
0
D
j
f
i
(
x
0
+
t
e
k
)
−
D
j
f
i
(
x
0
)
t
{\displaystyle \lim _{t\to 0}{\frac {\operatorname {D} _{j}f_{i}(\mathbf {x} _{0}+t\mathbf {e} _{k})-\operatorname {D} _{j}f_{i}(\mathbf {x} _{0})}{t}}}
,其中
e
k
{\displaystyle \mathbf {e} _{k}}
是第k 个单位向量。如果这个极限存在,称其为
f
i
(
x
)
{\displaystyle f_{i}(\mathbf {x} )}
在
x
0
{\displaystyle \mathbf {x} _{0}}
处的第(k , j )二阶偏导数,记作
D
k
j
2
f
i
(
x
0
)
{\displaystyle \operatorname {D} _{kj}^{2}f_{i}(\mathbf {x} _{0})}
。
黑塞矩阵是一个包含所有二阶偏导数的矩阵。这个矩阵只对定义于
R
n
{\displaystyle \mathbb {R} ^{n}}
的子集
S
{\displaystyle S}
的实值函数
f
(
x
)
:
S
→
R
{\displaystyle f(\mathbf {x} ):S\to \mathbb {R} }
有定义,是一个n ×n 矩阵。其定义如下:
^ 邸继征 (编). 矩阵论. 北京: 科学出版社. 2016. ISBN 978-7-03-049222-7 .
^ Magnus, Jan R.; Neudecker, Heinz. Matrix differential calculus with applications in statistics and econometrics. Wiley series in probability and statistics Third edition. Hoboken, NJ: Wiley. 2019. ISBN 978-1-119-54119-6 .
^ Magnus, Jan R.; Neudecker, Heinz. Matrix differential calculus with applications in statistics and econometrics. Wiley series in probability and statistics Third edition. Hoboken, NJ: Wiley. 2019. ISBN 978-1-119-54119-6 .
Lax, Peter D. 9. Calculus of Vector- and Matrix-Valued Functions. Linear algebra and its applications 2nd. Hoboken, N.J.: Wiley-Interscience. 2007. ISBN 978-0-471-75156-4 .