Minimize sum function after finding its derivative

116 Views Asked by At

According to the exercise I am making, the function $L = \frac{1}{n}\sum_{i=1}^n(y_i - b)^2$ should be minimized for $b = \frac{1}{n}\sum_{i=1}^n{y_i}$.

I have figured out that for $y_j$ with $j = 3$, this is the case:

$\frac{\partial}{\partial y_3} = \frac{\frac{1}{n}*((y_1-b)^2+(y_2-b)^2+(y_3-b)^2+...+(y_n-b)^2)}{y_3} = \frac{1}{n}*2(y_3-b)$

So I thought I could conclude that: $\frac{\partial}{\partial y_j} = \frac{1}{n}*2(y_3-b)$

In this case, if $y_j = b$, then $\frac{\partial}{\partial y_j} = 0$. Now I think I have found the extrema, but how do I find the minimum of function L?

1

There are 1 best solutions below

10
On BEST ANSWER

If I look at your result it seems that you have to minimize L w.r.t. parameter $b$. In this case you differentiate $L$ and set it equal to zero. We have to apply the chain rule when differentiating the squared brackets.

$$\frac{dL}{db}=2\sum_{i=1}^n(y_i - b)\cdot (-1)=0$$

We can omit the constants $2$ and $(-1)$.

$$\sum_{i=1}^n(y_i - b)=0$$

$$\sum_{i=1}^n y_i = \sum_{i=1}^nb$$

Can you proceed?