基本公式:
Y = A * X --> DY/DX = A'
Y = X * A --> DY/DX = A
Y = A' * X * B --> DY/DX = A * B'
Y = A' * X' * B --> DY/DX = B * A'
1. 矩阵Y对标量x求导:
相当于每个元素求导数后转置一下,注意M×N矩阵求导后变成N×M了
Y = [y(ij)] --> dY/dx = [dy(ji)/dx]
2. 标量y对列向量X求导:
注意与上面不同,这次括号内是求偏导,不转置,对N×1向量求导后还是N×1向量
y = f(x1,x2,..,xn) --> dy/dX =(Dy/Dx1,Dy/Dx2,..,Dy/Dxn)'
3. 行向量Y'对列向量X求导:
注意1×M向量对N×1向量求导后是N×M矩阵。
将Y的每一列对X求偏导,将各列构成一个矩阵。
重要结论:
dX'/dX = I
d(AX)'/dX = A'
4. 列向量Y对行向量X’求导:
转化为行向量Y’对列向量X的导数,然后转置。
注意M×1向量对1×N向量求导结果为M×N矩阵。
dY/dX' = (dY'/dX)'
5. 向量积对列向量X求导运算法则:
注意与标量求导有点不同。
d(UV')/dX = (dU/dX)V' + U(dV'/dX)
d(U'V)/dX = (dU'/dX)V + (dV'/dX)U'
重要结论:
d(X'A)/dX = (dX'/dX)A + (dA/dX)X' = IA + 0X' = A
d(AX)/dX' = (d(X'A')/dX)' = (A')' = A
d(X'AX)/dX = (dX'/dX)AX + (d(AX)'/dX)X = AX + A'X
6. 矩阵Y对列向量X求导:
将Y对X的每一个分量求偏导,构成一个超向量。
注意该向量的每一个元素都是一个矩阵。
7. 矩阵积对列向量求导法则:
d(uV)/dX = (du/dX)V + u(dV/dX)
d(UV)/dX = (dU/dX)V + U(dV/dX)
重要结论:
d(X'A)/dX = (dX'/dX)A + X'(dA/dX) = IA + X'0 = A
8. 标量y对矩阵X的导数:
类似标量y对列向量X的导数,
把y对每个X的元素求偏导,不用转置。
dy/dX = [ Dy/Dx(ij) ]
重要结论:
y = U'XV = ΣΣu(i)x(ij)v(j) 于是 dy/dX = [u(i)v(j)] = UV'
y = U'X'XU 则 dy/dX = 2XUU'
y = (XU-V)'(XU-V) 则 dy/dX = d(U'X'XU - 2V'XU + V'V)/dX = 2XUU' -2VU' + 0 = 2(XU-V)U'
9. 矩阵Y对矩阵X的导数:
将Y的每个元素对X求导,然后排在一起形成超级矩阵。
10.乘积的导数
d(f*g)/dx=(df'/dx)g+(dg/dx)f'
结论
d(x'Ax)=(d(x'')/dx)Ax+(d(Ax)/dx)(x'')=Ax+A'x(注意:''是表示两次转置)
比较详细点的如下:
http://lzh21cen.blog.163.com/blog/static/145880136201051113615571/
http://hi.baidu.com/wangwen926/blog/item/eb189bf6b0fb702b720eec94.html
其他参考:
Contents
Notation
Note that the Hermitian transpose is not used because complexconjugates are not analytic.
In the expressions below matrices andvectorsA,B,Cdonot depend onX.
Derivatives of Linear Products
Derivatives of Quadratic Products
Derivatives of Cubic Products
Derivatives of Inverses
Derivative of Trace
Note: matrix dimensions must result inann*nargument fortr().
Derivative of Determinant
Note: matrix dimensions must result inann*nargument fordet().
Jacobian
Ifyis a functionofx,thendyT/dxisthe Jacobian matrixofywith respecttox.
Its determinant,|dyT/dx|, istheJacobianofywithrespect toxandrepresents the ratio of thehyper-volumesdyanddx.The Jacobian occurs when changing variables in an integration:Integral(f(y)dy)=Integral(f(y(x))|dyT/dx|dx).
Hessian matrix
If f is a functionofxthen the symmetricmatrixd2f/dx2=d/dxT(df/dx)is theHessianmatrix off(x). A valueofxfor whichdf/dx=0correspondsto a minimum, maximum or saddle point according to whether theHessian is positive definite, negative definite or indefinite.
http://www.stanford.edu/~dattorro/matrixcalc.pdf
http://www.colorado.edu/engineering/CAS/courses.d/IFEM.d/IFEM.AppD.d/IFEM.AppD.pdf
http://www4.ncsu.edu/~pfackler/MatCalc.pdf
http://center.uvt.nl/staff/magnus/wip12.pdf