Minimizing a Function: Finding the Optimal Value of a in f(a)

  • Thread starter Thread starter autre
  • Start date Start date
  • Tags Tags
    Function
autre
Messages
116
Reaction score
0

Homework Statement



Let f(a)=\frac{1}{n-1}\sum_{i=1}^{n}(x_{i}-a)^{2}

Find the value of a that minimizes f(a) by replacing (x_{i}-a) by ((x_{i}-\bar{x})+(\bar{x}-a)).


2. The attempt at a solution
f(a)=\frac{1}{n-1}\sum_{i=1}^{n}((x_{i}-\bar{x})+(\bar{x}-a))^{2}=\frac{1}{n-1}\sum_{i=1}^{n}((x_{i}-\bar{x})^{2}+(\bar{x}-a){}^{2}+2(x_{i}-\bar{x})(\bar{x}-a))=\frac{1}{n-1}[\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}+\sum(\bar{x}-a){}^{2}+\sum2(x_{i}-\bar{x})(\bar{x}-a)]

I'm a little stuck here. Any ideas?
 
Physics news on Phys.org
Any ideas, guys?
 
autre said:
Any ideas, guys?

Try using \sum_{i=1}^{n} x_{i}=n \bar{x}.
 
Thanks!
 
autre said:

Homework Statement



Let f(a)=\frac{1}{n-1}\sum_{i=1}^{n}(x_{i}-a)^{2}

Find the value of a that minimizes f(a) by replacing (x_{i}-a) by ((x_{i}-\bar{x})+(\bar{x}-a)).


2. The attempt at a solution
f(a)=\frac{1}{n-1}\sum_{i=1}^{n}((x_{i}-\bar{x})+(\bar{x}-a))^{2}=\frac{1}{n-1}\sum_{i=1}^{n}((x_{i}-\bar{x})^{2}+(\bar{x}-a){}^{2}+2(x_{i}-\bar{x})(\bar{x}-a))
=\frac{1}{n-1}\left[\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}+\sum(\bar{x}-a){}^{2}+\sum2(x_{i}-\bar{x})(\bar{x}-a)\right]​

I'm a little stuck here. Any ideas?
In your final expression, the first sum doesn't depend on a. It's easy to make the other two equal to zero. Is that the minimum possible?

Is the third sum equal to zero for all values of a ?
 
It's easy to make the other two equal to zero. Is that the minimum possible?

I know that the minimum should be the mean a = 1\n\sum x_i. How do I make the other two equal to zero?
 
Last edited:
autre said:
I know that the minimum should be the mean a = 1\n\sum x_i. How do I make the other two equal to zero?

What is \Sigma^n_1 (x_i-\bar{x})?
 
autre said:
I know that the minimum should be the mean a = 1\n\sum x_i. How do I make the other two equal to zero?

Do you realize that \bar{x} is:
\displaystyle\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i \,?​

So you're saying that the solution is a=\bar{x}\,.
 
Back
Top