Derivative of a matrix using Kronecker product

359 Views Asked by At

I have this Equation (1) and I want derivative in respect to $\underline s $: $$diag(\underline s)\times C \times diag(\underline s)$$ that $\underline s $ is a $n \times 1$ vector and $C$ is an $n \times n$ matrix. If I open up the Equation, I can find derivative but I would like to find it with Kronecker product. I tried and reach to this: $$ ( E_j^T \otimes E_i^T )vec(\underline s \otimes I + I \otimes \underline s) $$ that $ E_j $ is all zeros matrix except (j,j) element that is one. actually, I replaced derivative and vec operator because for its linearity. anyone can help me to devectorizing this or Find derivative in another way? Is it correct to displacement of vec and derivation? thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

To combine your approach with the one in my comment...

First write the function and its differential using a Hadamard product $$\eqalign{ F &= {\rm Diag}(s)\,C\,{\rm Diag}(s) = C\odot ss^T \cr dF &= C\odot ds\,s^T + C\odot s\,ds^T \cr }$$ Define the diagonal matrix $$D_c={\rm Diag}\big({\rm vec}(C)\big)$$ and use it to vectorize the differential $$\eqalign{ df &= D_c\,{\rm vec}(ds\,s^T) + D_c\,{\rm vec}(s\,ds^T) \cr &= D_c\,(s\otimes I)\,ds + D_c\,(I\otimes s)\,ds \cr &= D_c\,\big(s\otimes I + I\otimes s\big)\,ds\cr }$$ Yielding the gradient of the vectorized function as $$\frac{\partial f}{\partial s} = D_c\,\big(s\otimes I + I\otimes s\big)$$