3

How to calculate the following

$$ \frac{\partial}{\partial x} \log (\det X(x))$$

where $X$ is a matrix in $\mathbb{R}^{n\times n}$ which is a function of $x\in \mathbb{R}^d$?

user550103
  • 2,688
user85361
  • 845
  • 1
    Do you know how to express a determinant as a sum? It will be a step in the right direction (Jacobi's formula). Also know that "inner times outer" applies here as well. – Michael Paris Jul 23 '18 at 06:26
  • @MichaelParis, no, I don't know. Would you please explain a little? – user85361 Jul 23 '18 at 06:53
  • 1
    https://en.m.wikipedia.org/wiki/Jacobi%27s_formula. The determinant of a matrix has a couple of useful representations as a sum, one of which can be used to simplify your expression – Michael Paris Jul 23 '18 at 06:57
  • relevant? Prove $\frac{\partial \rm{ln}|X|}{\partial X} = 2X^{-1} - \rm{diag}(X^{-1})$.. Here I say 'We first note that for the case where the elements of X are independent, a constructive proof involving cofactor expansion and adjoint matrices can be made to show that $\frac{\partial ln|X|}{\partial X} = X^{-T}$ (Harville). This is not always equal to $2X^{-1}-diag(X^{-1})$. The fact alone that X is positive definite is sufficient to conclude that X is symmetric and thus its elements are not independent.' @MichaelParis – BCLC Apr 16 '21 at 10:08

2 Answers2

2

The gradient of $\log \det X$ with respect to the entries of $X$ is $X^{-1}$, so the total derivative with respect to $x$ is $\sum_i \sum_j (X^{-1}(x))_{ij} (X'_{ij}(x))$. Here, $X_{ij}(x)$ denotes the $i,j$-entry of $X(x)$, and $X'_{ij}$ denotes the derivative of this entry with respect to $x$. $X^{-1}(x)$ denotes the matrix inverse of $X(x)$.

angryavian
  • 89,882
  • Thank you. Although it must be very easy, I'm a little confused. Could you please show it in matrix notation form? – user85361 Jul 23 '18 at 06:52
  • relevant? Prove $\frac{\partial \rm{ln}|X|}{\partial X} = 2X^{-1} - \rm{diag}(X^{-1})$.. Here I say 'We first note that for the case where the elements of X are independent, a constructive proof involving cofactor expansion and adjoint matrices can be made to show that $\frac{\partial ln|X|}{\partial X} = X^{-T}$ (Harville). This is not always equal to $2X^{-1}-diag(X^{-1})$. The fact alone that X is positive definite is sufficient to conclude that X is symmetric and thus its elements are not independent.' – BCLC Apr 16 '21 at 10:08
2

\begin{equation} \frac{\partial}{\partial x}\log(\det(X(x))) = \frac{1}{\det(X(x))} \mathrm{Tr}\left(\mathrm{Adj}(X(x)) \mathrm{d} X(x)\right) \end{equation} Edit:

"d" implies the gradient operator in the covariant form, which acts on the provided (1,1)-tensor in the usual way, making it a (2,1)-tensor.