[Math] the derivative of the determinant of a symmetric positive definite matrix

covariancederivativesdeterminant

According to matrix cookbook

$$\frac{\partial \det Y}{\partial x} = \det (Y) \text{Tr}\left( Y^{-1} \frac{\partial Y}{\partial x}\right) $$

Now assume $Y$ is a variance covariance matrix $\Sigma$, which is by definition symmetric and positive definite. Furthermore assume we derive for $x=\Sigma$. Does it follow that

$$\frac{\partial \det \Sigma}{\partial \Sigma} = \det (\Sigma) \text{Tr}\left( \Sigma^{-1} \frac{\partial \Sigma}{\partial \Sigma}\right) = \det (\Sigma) \text{Tr}( \Sigma^{-1}) ?$$

In a related post I asked a similar question and a reply seems to suggest (and the reply seems to give the correct result)

$$\frac{\partial \det \Sigma}{\partial \Sigma} = \det (\Sigma) \Sigma^{-1}.$$

So I wonder if I make a mistake in the second row of equations of if this is a special case due to the properties of $\Sigma$.

Best Answer

Note, that for symmetric matrix derevative of $\partial X/\partial x_{ij}$ is equal to $$ \frac{\partial X}{\partial x_{ij}} = E_{ij} + E_{ji} - E_{ij}E_{ij} $$ So, for trace of multiplication $X^{-1}$ and $\partial X/\partial x_{ij}$ we have $$ \text {tr}(X^{-1}E_{ij}) + \text {tr}(X^{-1}E_{ji}) - \text {tr}(X^{-1}E_{ij}E_{ij}) = (X^{-1})_{ji}+(X^{-1})_{ij} - (X^{-1})_{ii} $$ and $$ \text {tr}(X^{-1}\partial X/\partial X) = X^{-T} + X^{T} - \text {diag}(X^{-1}) = 2X^{-1} - \text {diag}(X^{-1}) $$ Finally, if $X^{T} = X$, we have that $$ \frac{\det(X)}{\partial X} = \det(X)(2X^{-1} - \text {diag}(X^{-1})) $$

P.S. $E_{ij}$ - zeros matrix with 1 on $ij$ position.