Differentiation with sigma notation can't catch bug

55 Views Asked by At

Seems like my knowledge about derivation with sigma notation is missing. I am stuck with the next problem. I am asked to differentiate next equation with respect to "a". $$ f(a,b) = \frac{1}{N}\sum_{i=1}^N(y_i-(ax_i+b))^2 \\ \frac{\partial{f}}{\partial{a}} = ? $$ The whole differentiation thing is more or less simple, but what I am stuck with. My result of the differentiation is: $$ \frac{\partial{f}}{\partial{a}} = \frac{1}{N}\sum_{i=1}^N2(y_i-ax_i-b)(-x_i) $$ Our teacher differentiated it as: $$ \frac{\partial{f}}{\partial{a}} = \sum_{i=1}^N(y_i-ax_i-b)(-x_i) $$ Why $\frac{1}{N}$ lost? And why 2 has left from the result? What I did wrong?

1

There are 1 best solutions below

1
On BEST ANSWER

Your work is correct, the $\frac 1N$ and $2$ should be there. You are about to set the derivative to zero to find an optimum. At that point they will divide out so the error will evaporate. It is easy to drop multiplicative constants in a derivative when you are about to set it to zero, but that doesn't change the fact that the stated derivative is incorrect.