# Getting the average of values with errors.

I have five data values each with an associated error. I want to find the mean of these values but also take the errors into account. How do I do this? Lets say the data values and errors are:

values = [10.0,10.2,10.4,10.6,10.8]
errors = [0.05,0.06,0.03,0.04,0.02]


Just to be clear, the first datum is (10.0 +/- 0.05).

My thoughts: Can I just get an average of the values (10.4) and an average of the errors (0.04) and therefore my overall average is (10.4 +- 0.04)?

Or do I need to add the errors in quadrature? Which gives (10.4 +- 0.095) .

How do I do this ?

## 1 Answer

You have to assume that there exists a random variable ${X_i}$ for each of your datum. Now, you want to be able to speak about an overall random variable $X$ defined as $$X = \frac{1}{5}\sum\limits_{i = 1}^5 {{X_i}}$$ The mean of $X$ is obtainable from $$E[X] = \frac{1}{5}\sum\limits_{i = 1}^5 {E[{X_i}]}$$ and for the standard deviation (which loosely speaking is a measure of error), we have $${\sigma _X} = \sqrt {E[{X^2}] - {{\left( {E[X]} \right)}^2}} = \sqrt {E\left[ {{{\left( {\frac{1}{5}\sum\limits_{i = 1}^5 {{X_i}} } \right)}^2}} \right] - {{\left( {\frac{1}{5}\sum\limits_{i = 1}^5 {{\mu _{{X_i}}}} } \right)}^2}}$$Now, it is usually assume that the random variables are independent, that is $$i \ne j \to E[{X_i}{X_j}] = 0$$so that we get $${\sigma _X} = \frac{1}{5}\sqrt {\sum\limits_{i = 1}^5 {{\sigma _{{X_i}}}^2} }$$

• Hi @SeyedMohsenAyyoubzadeh. That $\sigma_{X}$ with the square root is not the variance, it's the standard deviation. – Jose Arnaldo Bebita-Dris Oct 5 '14 at 8:02
• You lost me with "overall random variable" and "random variables" etc. Can you pop my values into your method and tell me what the answer is? Or show me how they fit in. – Kantura Oct 5 '14 at 8:06
• @JoseArnaldoDris Thanks, I edited my post. – Seyed Mohsen Ayyoubzadeh Oct 5 '14 at 8:32
• @Derek All of these are justifications for your second approach, that is the answer is $10.4 \pm 0.095$ – Seyed Mohsen Ayyoubzadeh Oct 5 '14 at 8:34
• @SeyedMohsenAyyoubzadeh Thanks , I understand now. – Kantura Oct 5 '14 at 8:39