derivative trace of matrix inverse square

54 Views Asked by At

Consider matrix M = $\sum_{j=1}^n p_jf(x_j)f^T(x_j)$, P,X - scalar vectors, $ f=\left(1,x_1,x_2,x_1x_2,x_1^2,\ x_2^2\right)^T, x1,x2 \in (-1, 1), p_j > 0$. I need find solution for $\frac{\partial tr(M^{-2})}{\partial p_j}$. Thanks!!!!

1

There are 1 best solutions below

0
On

$\def\p#1#2{\frac{\partial #1}{\partial #2}}\def\d{\operatorname{diag}}\def\D{\operatorname{Diag}}\def\m#1{\left[\begin{array}{r}#1\end{array}\right]}$Define the $f$-vectors a bit more concisely along with some related matrices $$\eqalign{ f(x) &= \m{1&x_1&x_2&x_1x_2&x_1^2&x_2^2}^T \\ f_j &= f(x_j) \\ F &= \m{f_1&f_2&\ldots &f_n} \\ p &= \m{p_1&p_2&\ldots &p_n}^T \\ M &= F\D(p)\,F^T \;=\; M^T \\ }$$ And let's use a colon to denote the inner/trace product $$A:B = {\rm Tr}(A^TB)$$ Write the objective function using the above variables and calculate its gradient. $$\eqalign{ \phi &= M^{-1}:M^{-1} \\ d\phi &= 2M^{-1}:dM^{-1} \\ &= -2M^{-1}:M^{-1}\,dM\,M^{-1} \\ &= -2M^{-3}:dM \\ &= -2M^{-3}:F\D(dp)\,F^T \\ &= -2F^TM^{-3}F:\D(dp) \\ &= -2\d(F^TM^{-3}F):dp \\ \p{\phi}{p} &= -2\d(F^TM^{-3}F) \\ }$$ So there's the gradient. To enforce the positivity constraint use a projected gradient rather than a regular gradient descent method.