derivative of a diagonal matrix

1k Views Asked by At

Given the weight graph $G(V,E,w)$ where $w_{}$ is a function which assigns a weight to an edge in graph G, we define the adjacency matrix $A$ by $$A_{ij}=\begin{cases} w_{ij},&\text{if }(i,j) \in E, \\ 0 & \text{otherwise}.\end{cases}$$ The degree matrix of a weighted graph is a diagonal matrix $D$ such that $$D_{ii}=\sum_j A_{ij}.$$ Which is the derivative of $P=D^{-1}$ with respect to $A$? $$\frac{\partial P}{{\partial\ A}}=\frac{\partial(D^{-1})}{\partial\ A}$$

I was wondering if any one could help me to find out the answer.

1

There are 1 best solutions below

0
On

Let $e$ be the vector whose components are all ones.

Then $$\eqalign{ b &= Ae \cr D &= \operatorname{Diag}(b) \cr P &= D^{-1} \cr dP &= -P\,dD\,P \cr }$$ Those matrices are all diagonal, so apply the diag() operator (which is the reverse of the Diag() operator) to obtain $$\eqalign{ dp &= -P^2\,db \cr &= -P^2\,dA\,e \cr }$$ Now vectorize both sides $$\eqalign{ dp &= -\operatorname{vec}(P^2\,dA\,e) \cr &= -(e^T\otimes P^2)\,\operatorname{vec}(dA) \cr &= -(e^T\otimes P^2)\,da \cr\cr \frac{\partial p}{\partial a} &= -\,e^T\otimes P^2 \cr\cr }$$ If you don't wish to vectorize, then you must use higher-order tensors to express the result.

Let $T$ be a 3rd-order tensor, and $F$ a 4th-order tensor, with components given by $$\eqalign{T_{ijk} &= \begin{cases} 1 &\text{if }(i=j=k) \\ 0 & \text{otherwise}\end{cases}\cr F_{ijkm} &= \delta_{ik}\,\delta_{jm} \cr }$$ Then picking up the previous thread just before vectorization $$\eqalign{ dp &= -P^2\,dA\,e \cr \cr dP &= T\,dp \cr &= -T\,P^2\,dA\,e \cr &= -T\,P^2\,F\,e^T:dA \cr \cr \frac{\partial P}{\partial A} &= -T\,P^2\,F\,e^T \cr }$$