Gradient of ${\bf z} \mapsto- \frac12 \operatorname{tr} \left( {\bf A} \left( {\bf Y} - {\bf x} {\bf z}^\top \right) {\bf B} ( \cdot )^\top \right)$

145 Views Asked by At

Given $3 \times 3$ symmetric matrix $\bf A$ and $5 \times 5 $ symmetric matrix $\bf B$, let the scalar field $f : \Bbb R^5 \to \Bbb R$ be defined by

$$ f ({\bf z}) := - \frac12 \operatorname{tr} \left( {\bf A} \left( {\bf Y} - {\bf x} {\bf z}^\top \right) {\bf B} \left( {\bf Y} - {\bf x} {\bf z}^\top \right)^\top \right) $$

where $\operatorname{tr}$ is trace operator, ${\bf x} = {\bf 1}_3$ and $\bf Y$ is a $3 \times 5$ matrix.

I can find $\nabla_{\bf z} f$ by expanding operations inside the trace and following the derivative of trace rules outlined in The Matrix Cookbook. However, those rules are based on the matrices. Since in my case I am taking a derivative with respect to a vector $\bf z$, would it be reasonable to use those rules? If not, how can I find $\nabla_{\bf z} f$ in this setting?

1

There are 1 best solutions below

2
On

Using the cyclic property of the trace,

$$ f ({\bf z}) := - \frac12 \operatorname{tr} \left( {\bf A} \left( {\bf Y} - {\bf x} {\bf z}^\top \right) {\bf B} \left( {\bf Y} - {\bf x} {\bf z}^\top \right)^\top \right) = \cdots = - \frac12 \left( \left( {\bf x}^\top {\bf A} \, {\bf x} \right) \left( {\bf z}^\top {\bf B} \, {\bf z} \right) - 2 \left\langle {\bf B} \, {\bf Y}^\top {\bf A} \, {\bf x} , {\bf z} \right\rangle + \operatorname{tr} \left( {\bf A} {\bf Y} {\bf B} {\bf Y}^\top \right) \right) $$

Can you take it from here?