I need to find the value and error of a weighted sum of values all with their own respective error.
Say I have three data points:
$ x_1 = 7 \pm 1$
$ x_2 = 9 \pm 0.8$
$ x_3 = 10 \pm 0.7$
I need to find the mean of these values, weighted by the magnitude of their errors so that values with greater error have less weighting.
I have tried a couple of approaches but have gotten unreasonable answers. Searching the web, there seems to be a lot of noise and cannot find anything specifically that I am looking for.
My initial approach was to calculate in this manner:
$\bar{x} = \frac{\sum_i x_iw_i}{\sum_i w_i}$
For my example this gives:
$\bar{x} = \frac{7*(1)+ 9*(0.8) + 10*(0.7)}{1+0.8+0.7} = 8.48$
I know this is obviously incorrect as it gives greater weighting to the values with larger error. I'm struggling to work out a mathematically proper fix. Can I just take the inverse of the weighting?
Errors I can propagate trivially once I know how to calculate $\bar{x}$
According to Chapter 7, "Weighted Averages" in An Introduction to Error Analysis, Second Edition, by John R. Taylor, the appropriate procedure is as follows.
Let's say your three values are $x_i \pm \sigma_i$ for $i=1,2,3$. Compute weights $w_i$ by $$w_i = \frac{1}{\sigma_i^2}$$ Then your best estimate is the weighted average $$x_{wav} = \frac{\sum w_i x_i}{\sum w_i}$$ The idea is that these weights minimize the variance of $x_{wav}$.