0
$\begingroup$

Say we want to derive the following sum with respect to $A_i$ $$S=\sum_{j=1}^M\left(\sum_{i=0}^NA_ix_j^i-y_j\right)^2$$ In the book the derivative is given as $$\frac{dS}{dA_i}=2\sum_{j=1}^M\left(\sum_{i=0}^NA_ix_j^i-y_i\right)x_j^l$$ where $l$ equals the degree of $x$ that corresponds to $A_i$ which we're deriving with respect to. Now this makes perfect sense, when $A_i>0$ for all $i$. But I'm wondering what if we drop the assumption that all of $A_i$ must be positive, wouldn't the derivative look like this $$\frac{dS}{dA_i}=sgn(A_i)\sum_{j=1}^M\left(\sum_{i=0}^NA_ix_j^i-y_i\right)x_j^l$$ since we can stumble upon some $A_i$ that is negative and if we derive by it a minus sign will go in front, changing the equation. Is this a mistake?

$\endgroup$
  • $\begingroup$ You did make a mistake. Don't know where you get the minus sign from. We have $\frac{d}{dx} x^2 = 2x$. End of transmission. $\endgroup$ – Tobias Nov 7 '16 at 18:32
  • $\begingroup$ @Tobias Apply chain rule. I don't "get" a minus sign, I'm just trying to write out a general form of this derivative, that would include the case when there is at least one $A_i<0$ $\endgroup$ – bonehead Nov 7 '16 at 18:37
  • $\begingroup$ The chain rule does not change a thing in what I have written. Sums and products with some constants are all linear operations that re-appear unchanged in the derivative. $\endgroup$ – Tobias Nov 7 '16 at 19:02
  • $\begingroup$ Ah, yes. One more thing. The symbol $i$ is bound as summation index in the inner sum of the derivative. The formula looks like you actually mean $dS / dA_l$ instead of $d S / dA_i$. $\endgroup$ – Tobias Nov 7 '16 at 19:07
  • $\begingroup$ Note, the derivative of $\sum_{i=0}^NA_ix_j^i-y_j$ w.r.t. $A_l$ is $x_j^l$. This is what you need as inner derivative and this is also what the book says. The outer derivatives are twice the sums that are squared in the original equation. $\endgroup$ – Tobias Nov 7 '16 at 19:11
0
$\begingroup$

Assuming all $y_j$ are zeros. Moreover, let all $x_j^i$ be zeros too except $x_1^1=t$. Then we have $S=(A_1t)^2$. What is the derivative of $S$ with respect to $A_1$:

  • $2(A_1t)t$ (the book),
  • $\operatorname{sgn}(A_1)(A_1t)t$ (your suggestion)?
| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.