How to find the derivative of the following function?
$$\mbox{tr} \left( X'A' \left(B + X'CX + DX + X'D'\right)^{-1}AX \right)$$
I thought to write it using colon notation, but the quantities and not separable.
How to find the derivative of the following function?
$$\mbox{tr} \left( X'A' \left(B + X'CX + DX + X'D'\right)^{-1}AX \right)$$
I thought to write it using colon notation, but the quantities and not separable.
On
User greg already provided you with an answer, I just want to point you to this new online tool: http://www.matrixcalculus.org/ simply enter tr(X' * A' * inv(B + X'*C*X + D*X +X'*D')*A*X)
Define some additional matrices to hide the complexity that will occur when terms are expanded. $$\eqalign{ P &= B + X^TCX + DX + X^TD^T \cr Q &= AX \cr R &= P^{-T}QQ^TP^{-T} \cr S &= P^{-1}+P^{-T} \cr }$$ Write the function in terms of these new variables. Then find its differential and gradient. $$\eqalign{ \phi &= {\rm Tr}\big(P^{-1}QQ^T\big) \,\,=\,\, P^{-1}:QQ^T \,\,=\,\, QQ^T:P^{-1} \cr d\phi &= P^{-1}:2\,{\rm sym}(dQ\,Q^T) + QQ^T:dP^{-1} \cr &= (P^{-1}+P^{-T}):dQ\,Q^T - QQ^T:(P^{-1}\,dP\,P^{-1}) \cr &= SQ:dQ - R:dP \cr &= SQ:A\,dX - R:\big(dX^TCX+dX^TD^T+X^TC\,dX+D\,dX\big) \cr &= A^TSQ:dX - R(CX+D^T)^T:dX^T - (X^TC+D)^TR:dX \cr &= A^TSQ:dX - (CX+D^T)R^T:dX - (C^TX+D^T)R:dX \cr &= \Big(A^TSQ - (CX+D^T)R^T - (C^TX+D^T)R\Big):dX \cr \frac{\partial \phi}{\partial X} &= A^TSQ - (CX+D^T)R^T - (C^TX+D^T)R \cr }$$ where the function $\,{\rm sym}(X) = \tfrac{1}{2}(X+X^T)$
and the trace product is $\,A:B = {\rm Tr}(A^TB)$