Derivative of Matrices

83 Views Asked by At

Assuming that the following are matrices with their corresponding dimensions: $\mathbf{X}\in\mathbb{R}^{p\times d},\mathbf{A}\in \mathbb{R}^{p\times p}$ which is symmetric and $\mathbf{B} \in \mathbb{R}^{(p-d)\times (p-d)}$, then what is the derivative: $\frac{\partial}{\partial \mathbf{X}}\log\big|\mathbf{X}^T\mathbf{A}\mathbf{X}\mathbf{B}\big|$ Derivation: $\frac{\partial }{\partial X}\log\big|\mathbf{X}^T\mathbf{A}\mathbf{X}\mathbf{B}\big|=\frac{1}{\big|\mathbf{X}^T\mathbf{A}\mathbf{X}\mathbf{B}\big|}\frac{\partial}{\partial\mathbf{X}}\big|\mathbf{X}^T\mathbf{A}\mathbf{X}\mathbf{B}\big| $

1

There are 1 best solutions below

0
On

Let $M = X^TAX\,\,$ and write the function in terms of this new variable, then find its differential and gradient $$\eqalign{ f &= \log \det M \cr\cr df &= d(\log\det M) \cr &= d({\rm tr}\log M) \cr &= M^{-T}:dM\cr &= M^{-T}:d(X^TAX)\cr &= M^{-T}:(dX^TAX + X^TA\,dX)\cr &= M^{-1}:(AX)^TdX + M^{-T}:X^TA\,dX \cr &= AXM^{-1}:dX + A^TXM^{-T}:dX \cr &= (AXM^{-1} + A^TXM^{-T}):dX \cr\cr \frac{\partial f}{\partial X} &= AXM^{-1} + A^TXM^{-T} \cr }$$where colons denote the Frobenius Inner Product.

Since $A$ is symmetric, $M$ is too, and the gradient can be simplified to $$\eqalign{ \frac{\partial f}{\partial X} &= 2AXM^{-1} \cr &= 2AX(X^TAX)^{-1} \cr }$$