Factoring a matrix out of a summation

156 Views Asked by At

I'm trying to compute the derivative of this sum \begin{equation} \frac{\partial}{\partial \mathbf{A}} \frac{\lambda}{2}\sum_{i=1}^{q} \|\mathbf{YS}_i-\mathbf{YQ}_i\mathbf{AS}_i\|_{F}^2 \end{equation} where

  • $\mathbf{Y}\in \mathbb{R}^{m\times n}$ and $m<n$
  • $\mathbf{S}_i \in \mathbb{R}^{n\times l}$ and $l<n$
  • $\mathbf{Q}_i=\mathbf{S}_i\mathbf{S}_i^T$ is a symmetric $n\times n$ matrix, i.e. $\mathbf{Q}_i=\mathbf{Q}_i^T$
  • $\mathbf{A} \in \mathbb{R}^{n\times n}$ with its diagonal elements equal to zero. (diag$(\mathbf{A})=0$)

Computing the derivative I obtain \begin{equation} \lambda\sum_{i=1}^q -\mathbf{Q}_i^T\mathbf{Y}^T\mathbf{YQ}_i^T+\mathbf{Q}_i^T\mathbf{Y}^T\mathbf{YQ}_i\mathbf{AQ}_i^T \end{equation} It is possible to factor out the matrix $\mathbf{A}$ of this summation ? How ? Thanks in advance,