Can anyone explain to me why $$\frac{d}{d\theta }\left\|\textbf{Aw}-\theta(1-c)\textbf{1} \right\|^{2}= 0$$ is equivalent to $$2(1-c)\textbf{1}^T(\theta(1-c)\textbf{1}-\textbf{Aw})=0$$? I'm not very good with the term trace or derivative of matrices. So please also give me some references for me. Even the explanation I found here could not enlighten me. The part that still confuses me especially is why the matrix $\textbf{1}$ is transposed and moved to the front. Please help. Thanks.
Asked
Active
Viewed 146 times
0
-
Just apply the Leibniz-rule. – Michael Hoppe May 09 '22 at 14:07
1 Answers
1
$ \def\t{\theta}\def\l{\lambda}\def\o{{\tt1}}\def\p{\partial} \def\LR#1{\left(#1\right)} \def\trace#1{\operatorname{Tr}\LR{#1}} \def\qiq{\quad\implies\quad} \def\fracLR#1#2{\LR{\frac{#1}{#2}}} \def\gradd#1#2{\frac{d #1}{d #2}} \def\c#1{\color{red}{#1}} $Define the vector variables $${ x = \LR{1-c}\o, \qquad z = \LR{\t x - Aw}, \qquad \c{dz = d\t\;x} }$$ Write your function in terms of these variables, then calculate the differential and gradient. $$\eqalign{ \l &= \;\|z\|^2 \;=\; z^Tz \\ d\l &= 2\,\c{dz}^Tz = 2\,\c{d\t\,x}^Tz \\ \gradd{\l}{\t} &= 2x^Tz \;=\; 2\LR{\t\,x^Tx-x^TAw} \\ }$$ Setting the gradient to zero yields $$\eqalign{ \t\,x^Tx &= x^TAw \qiq \t = \frac{x^TAw}{x^Tx} \\ }$$
greg
- 40,033
-
-
@Haha For real vectors the inner product is commutative, i.e. $;x^Ty=y^Tx.;$ Therefore $$d(z^Tz);=;z^Tdz+dz^Tz;=;2,dz^Tz$$ – greg May 09 '22 at 12:43