Partial Derivative of sums of vector with respect to another

509 Views Asked by At

What is the derivative, with respect to w, of

$\lambda_1y_1X_1w + \lambda_2y_2X_2w + ... \lambda_ny_nX_nw$

Where $y_i$ and $\lambda_i$ are constants, $X_i$ is 1 by n, and w is n by 1?

My first thought was that it was the sum of the $\lambda_iy_iX_i$ (factoring out w), but this didn't make sense to me because w is not in the front of the expression, and this creates a "sum" of 1 by n matrices, which didn't make sense.

2

There are 2 best solutions below

0
On

Hint. If $L$ is a linear continuous function, then it is differentiable at every $w$ and $L'(w)=L.$

0
On

Let's consider a simpler example. Namely, consider taking the derivative of $$ f(x)=ca^{\intercal}x $$ where $c$ is a constant, $a$ is a vector, and $x$ is a vector. Note that we can rewrite the above as $$ f(x)=c\sum_{i}a_{i}x_{i}. $$ Now that we have gotten rid of the vector notation, the problem can be solved using ordinary calculus. In particular, $$ \frac{\partial f}{\partial x_{j}}(x)=\frac{\partial}{\partial x_{j}}\left[c\sum_{i}a_{i}x_{i}\right]=c\sum_{i}a_{i}\frac{\partial}{\partial x_{j}}\left[x_{i}\right]=ca_{j}. $$ Putting this back into vector notation, $$ \nabla f(x)=ca. $$ See if you can apply the same idea to your problem.


Note: it would have also been valid to conclude $$\nabla f(x)=ca^\intercal.$$ This depends on the convention you choose to use.