Question about the matrix cookbook

363 Views Asked by At

I've been learning matrix calculus by myself, and sometimes use this as a quick references: https://www.math.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf.

I got confused regarding two equations in this book. Eq.38 states that $\partial(ln(det(X)))=Tr(X^{-1}\partial{X})$. This is the equation that I've been using often recently. However, I just noticed that the other equation, Eq.51, states that $\frac{\partial\ln|det(X)|}{\partial{X}}=(X^{-1})^{T}$.

I can observe some differences between the two equations. E.g., Eq.38 is about partial derivative wrt some parameters that are arguments of $X$ while Eq.51 seems to be about the derivative wrt to the matrix $X$. In addition, Eq.51 involves $|det(X)|$ while eq(38) involves only $det(X)$.

Still, I think I haven't appreciated the difference between the two. Can anyone help? Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

A way to interpret this is that the equation $$ \partial \ln |\det X| \;\; =\;\; Tr \left (X^{-1}\partial X\right ) $$

is expressing the notion of a directional derivative where we have the inner product of the derivative of $\ln |\det X|$ in the direction of $\partial X$, seen as a tangent vector. Since the Euclidean inner product for matrices is given by $\langle A,B\rangle = Tr (A^TB)$, we can interpret this fully as saying that the derivative of the function is just given by the transpose of the expression inside the trace which is not part of the directional derivative. In other words, we precisely have that

$$ \frac{\partial \ln |\det X|}{\partial X} \;\; =\;\; \left (X^{-1}\right )^T. $$

It's tempting to try to unravel the derivative in terms of the quantity $\partial X$ on the right hand side, but it's best to think of this as a dot product between the derivative of the function and some other vector.