7

How can I differentiate the following by $\mathbf{W}$ ?

\begin{equation} \mathbf{Y} = (\mathbf{W}^T\mathbf{x} + b)^2 \end{equation}

Where $\mathbf{W} \in \mathcal{R}^{d\times D}$ and $\mathbf(x)\in \mathcal{R}^{d\times 1}$

How to calculate $\partial \mathbf{Y}/\partial \mathbf{W}$ ?

user570593
  • 1,099
  • 2
  • 13
  • 19

1 Answers1

3

Matrix calculus is used in such cases. Your equation looks like it's from OLS (least squares) theory. In those you differentiate by vector $x$ some quadratic forms like $\frac{\partial (x'A'Ax)}{\partial x}$. Look up relevant formulae in my link above.

If you really are up to differentiating by matrices not vectors, you'll end up with tensors. Tensors are fun, but so far I haven't seem them used a lot in statistics. They're ubiquitous in physics, btw. Again, follow the link I gave.

Aksakal
  • 55,939
  • 5
  • 90
  • 176