How to calculate the derivative of log det matrix?
How to calculate the derivative with respect to $X$ of: $$ \log \mathrm{det}\, X $$ here $X$ is a positive definite matrix, and det is the determinant of a matrix.
How to calculate this? Thanks!
I know it's a classical problem, but I can't find some clear material from the Internet. So some good reference is also very helpful!
The hardness for me to understand is that the domain of $X$ is confined to be $S^n$. Therefore, for each symmetric matrix $X$, a specific $n(n+1)/2$-dimension vector would represent it. But the result is $X^{-1}$ (if I remember it right), a matrix form with $n^2$ elements. How to interpret the matrix form result?
Solution 1:
If $X$ is invertible, then $D \det (X) (H) = (\det X) \operatorname{tr} (X^{-1} H)$.
If $\phi = \log \circ \det$, then $D \phi(X)(H) = {1 \over \det X}(\det X) \operatorname{tr} (X^{-1} H) = \operatorname{tr} (X^{-1} H)$.
Note that using the Frobenius norm, this gives $\nabla \phi(X) = X^{-T}$.