Gradient of $\sum_{i,j}^n A_{ij}x_i^TB^iC{B^j}^Tx_j$

72 Views Asked by At

Suppose I have a symmetric matrix $A$ and $C$ and matrices $B_i$ of respective size. Then for vectors (of different dimension) $x_i$ I define the function

$$f(x_1,\dots,x_n)=\sum_{i,j=1}^n A_{ij}x_i^TB_iC{B_j}^Tx_j$$

and I would like to calculate the derivative or gradient of it. The reason I would like to find a solution of $\nabla f =0$.

Using the symmetry of $A$ I've ended up with

$$ \nabla f = 2\left[\begin{array}{@{}c@{}} \sum_{i=1}^nA_{1i}B_1C{B_i}^Tx_i \\ \sum_{i=1}^nA_{2i}B_2C{B_i}^Tx_i \\ \vdots \\ \sum_{i=1}^nA_{ni}B_nC{B_i}^Tx_i \end{array} \right]$$

is this correct?

1

There are 1 best solutions below

5
On BEST ANSWER

$$ f \left( {\bf x}_1, \dots, {\bf x}_n \right) := \sum_{i,j=1}^n a_{ij} {\bf x}_i^\top {\bf B}_i {\bf C} \, {\bf B}_j^\top {\bf x}_j = \sum_{i,j=1}^n {\bf x}_i^\top \underbrace{\left( a_{ij} {\bf B}_i {\bf C} \, {\bf B}_j^\top \right)}_{=: {\bf Q}_{ij}} {\bf x}_j = {\bf x}^\top {\bf Q} \, {\bf x}$$

where

$$ {\bf Q} := \mbox{diag} \left( {\bf B}_1, \dots, {\bf B}_n \right) \left( {\bf A} \otimes {\bf C} \right) \mbox{diag} \left( {\bf B}_1, \dots, {\bf B}_n \right)^\top $$

where $\otimes$ denotes the Kronecker product. Note that $\bf Q$ is symmetric. Thus,

$$ \nabla_{{\bf x}} f \left( {\bf x} \right) = 2 \, {\bf Q} \, {\bf x} $$