I know that $\bar{x}$ makes absolute result of $\sum_{i=0}^n (x_i-\alpha)$ minimum. In fact it makes it zero. But how to find what value of $\alpha$ makes $\sum_{i=0}^n (x_i-\alpha)^2$ minimal? What is the best approach?
2 Answers
As I mentioned in comments, showing what minimizes $\sum (x_i-\alpha)^2$ can be done in several ways, such as by simple calculus, or by writing $\sum (x_i-\alpha)^2=\sum (x_i-\bar{x}+\bar{x}-\alpha)^2$. Let's look at the second one:
$\sum (x_i-\alpha)^2=\sum (x_i-\bar{x}+\bar{x}-\alpha)^2$ $\hspace{2.55cm}=\sum (x_i-\bar{x})^2+\sum(\bar{x}-\alpha)^2+2\sum(x_i-\bar{x})(\bar{x}-\alpha)$ $\hspace{2.55cm}=\sum (x_i-\bar{x})^2+\sum(\bar{x}-\alpha)^2+2(\bar{x}-\alpha)\sum(x_i-\bar{x})$ $\hspace{2.55cm}=\sum (x_i-\bar{x})^2+\sum(\bar{x}-\alpha)^2+2(\bar{x}-\alpha)\cdot 0$ $\hspace{2.55cm}=\sum (x_i-\bar{x})^2+\sum(\bar{x}-\alpha)^2$
Now the first term is unaltered by the choice of $\alpha$ and the last term can be made zero by setting $\alpha=\bar{x}$; any other choice leads to a larger value of the second term. Hence that expression is minimized by setting $\alpha=\bar{x}$.
- 282,281
Putting the first derivative (with respect to $\alpha$) equal to zero you find $2\sum_i (x_i -\alpha) (-1) = 0$ so $\sum_i x_i = n \alpha$ or $\alpha = \frac{1}{n} \sum_i x_i$
As to the question of what value for $\alpha$ minimizes $\sum (x_i-\alpha)^2$, this can be achieved in several ways, such as by simple calculus, or by writing $\sum (x_i-\alpha)^2=\sum (x_i-\bar{x}+\bar{x}-\alpha)^2$ and then expanding and simplifying. I think the first approach is covered in a number of questions already on our site; the second approach may be as well. I'll see if I can find some links
– Glen_b Oct 11 '15 at 09:39