Demonstrate this matrix derivative expression with the formulas of this table.

33 Views Asked by At

I'm doing this problem: Calculate $\frac{∂||Ax-b||^2}{∂x} = 2A^T (A-b) $. Knowing that $\frac{∂||x||^2}{∂x} = 2x $ so far I have this: $$\frac{∂||Ax-b||^2}{∂(Ax-b)} \frac{∂(Ax-b)}{∂x} = 2(Ax-b)A$$

I don't know how to continue from there. To solve this I can use the following formulas: $$1. \frac{∂x^t b}{∂x} = b$$ $$2. \frac{∂b^t x}{∂x} = b$$ $$3. \frac{∂Ax}{∂x} = A$$ $$4. \frac{∂x^tAx}{∂x} = 2Ax$$ $$5. \frac{∂x^tAx}{∂x} = (A+A^T)x$$

1

There are 1 best solutions below

0
On

Just use the product rule: $$\begin{align}d_p||Ax-b||^2 &=d_p\langle Ax+b,Ax+b\rangle\\ &=2\langle Ap,Ax+b\rangle\\ &=\langle p,2A^T(Ax+b)\rangle, \end{align}$$ hence the gradient of $||Ax+b||^2$ is $2A^T(Ax+b)$.