矩阵、向量求导法则
(1)行向量对元素求导 设\(\pmb{y}^T = [y_1 \cdots y_n]\)是\(n\)维行向量,\(x\)是元素,则 \[\frac{\partial \pmb{y}^T}{\partial x} = [\frac{\partial y_1}{\partial x} \cdots \frac{\partial y_n}{\partial x}]\]
(2)列向量对元素求导
设\(\pmb{y} = \left[\begin{matrix} y_1 \\ \vdots \\ y_m \end{matrix} \right]\)是\(m\)维列向量,\(x\)是元素,则 \[\frac{\partial \pmb{y}}{\partial x} = \left[\begin{matrix} \frac{\partial y_1}{\partial x} \\ \vdots \\ \frac{\partial y_n}{\partial x} \end{matrix} \right]\]
(3)矩阵对元素求导
设\(\pmb{Y} = \left[ \begin{matrix} y_{11} & \cdots & y_{1n} \\ \vdots & \dots & \vdots \\ y_{m1} & \dots & y_{mn} \end{matrix} \right]\)是\(m \times n\)矩阵,\(x\)是元素,则 \[\frac{\partial \pmb{Y}}{\partial x} = \left[ \begin{matrix} \frac{\partial y_{11}}{\partial x} & \cdots & \frac{\partial y_{1n}}{\partial x} \\ \vdots & \dots & \vdots \\ \frac{\partial y_{m1}}{\partial x} & \dots & \frac{ \partial y_{mn}}{\partial x} \end{matrix} \right]\]
(4)元素对行向量求导 设\(y\)是元素,\(\pmb{x}^T = [x_1 \cdots x_q]\)是\(q\)维行向量,则 \[\frac{\partial y}{\partial \pmb{x}^T} = [\frac{\partial y}{\partial x_1} \cdots \frac{\partial y}{\partial x_q}]\]
(5)元素对列向量求导 设\(y\)是元素,\(\pmb{x} = \left[ \begin{matrix} x_1 \\ \vdots \\ x_p \end{matrix} \right]\)是\(p\)维列向量,则 \[\frac{\partial y}{\partial \pmb{x}} = \left[ \begin{matrix} \frac{\partial y}{ \partial x_1} \\ \vdots \\ \frac{\partial y}{\partial x_p} \end{matrix} \right]\]
(6)元素对矩阵求导
设\(y\)是元素,\(\pmb{X} = \left[ \begin{matrix} x_{11} & \cdots & x_{1q} \\ \vdots & \dots & \vdots \\ x_{p1} & \dots & x_{pq} \end{matrix} \right]\)是\(p \times q\)矩阵,则 \[\frac{\partial y}{\partial \pmb{X}} = \left[ \begin{matrix} \frac{\partial y}{\partial x_{11}} & \cdots & \frac{\partial y}{\partial x_{1q}} \\ \vdots & \dots & \vdots \\ \frac{\partial y}{\partial x_{p1}} & \dots & \frac{\partial y}{\partial x_{pq}} \end{matrix} \right]\]