Should there be a signum function in the derivative of this sum?

166 Views Asked by At

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?

1

There are 1 best solutions below

0
On

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)?