https://i.stack.imgur.com/1EIpR.jpg https://i.stack.imgur.com/O7OCP.jpg
I have no idea how the answer is calculated, because there are some transpose matrix. I don't know i should treat them as constant or not.
https://i.stack.imgur.com/1EIpR.jpg https://i.stack.imgur.com/O7OCP.jpg
I have no idea how the answer is calculated, because there are some transpose matrix. I don't know i should treat them as constant or not.
Did you try to write down the function? For instance $$ r^T w = \sum_{i=1}^n r_i w_i $$
and so the partial derivatives are given by $\frac{\partial (r^T w)}{\partial w_i } = r_i$. Considering the definition of the gradient, you see that $\nabla(r^T w) = r$. As for the quadratic term, you can check that $$ w^T R w = \sum_{i=1}^n \sum_{j=1}^n R_{ij} w_i w_j,$$
compute the partial derivatives, and conclude that in fact $\nabla(\frac 12 w^T R w) = R w$.