# Error propagation on weighted mean

I understand that, if errors are random and independent, the addition (or difference) of two measured quantities, say $x$ and $y$, is equal to the quadratic sum of the two errors. In other words, the error of $x + y$ is given by $\sqrt{e_1^2 + e_2^2}$, where $e_1$ and $e_2$ and the errors of $x$ and $y$, respectively.

However, I have not yet been able to find how to calculate the error of both the arithmetic mean and the weighted mean of the two measured quantities. How do errors propagate in these cases?

-

The first assertion assumes one takes mean squared errors, which in probabilistic terms translates into standard deviations.

Now, probability says that the variance of two independent variables is the sum of the variances. Hence, if $z = x + y$ , $\sigma_z^2 = \sigma_x^2 + \sigma_y^2$ and $$e_z = \sigma_z = \sqrt{\sigma_x^2 + \sigma_y^2} = \sqrt{e_x^2 + e_y^2}$$

Knowing this, and knowing that $Var(a X) = a^2 Var(X)$, if $z = a x + (1-a) y$ (weighted mean, if $0\le a \le1$) we get:

$$\sigma_z^2 = a^2\sigma_x^2 + (1-a)^2\sigma_y^2$$

$$e_z = \sqrt{a^2 e_x^2 + (1-a)^2 e_y^2} = a \sqrt{ e_x^2 + \left(\frac{1-a}{a}\right)^2 e_y^2}$$

In particular, if $a=1/2$ , then $e_z = \frac{1}{2}\sqrt{ e_x^2 + e_y^2}$

-
If I understand it correctly, and in a more general form, if we had $n$ independent variables with their corresponding weights, $c_{1}, c_{2}...c_{n}$, the error of their weighted mean (when $\sum_{i=1}^n{c_{i}} = 1$) would be $\sqrt{c_{1}^2 e_1^2 + c_{2}^2 e_2^2 + ... + c_{n}^2 e_n^2}$. Right? –  plok Mar 23 '12 at 10:56
@plok that's right –  leonbloy Mar 23 '12 at 12:12
Thanks so much. –  plok Mar 23 '12 at 12:50

The arithmetic mean is just a scaled version of the sum, so you just need to know that the error scales as the quantity itself under scaling; thus the error in the arithmetic mean is $\sqrt{e_1^2+e_2^2}/2$. (You need to enclose the argument of the root in curly braces instead of parentheses to have it displayed under the square root.)

For more general error propagation, you need to multiply the errors with the partial derivatives with respect to the individual quantities. In the case of the geometric mean, $g(x,y)=\sqrt{xy}$, these are

$$\frac{\partial g}{\partial x}=\frac12\sqrt{\frac yx}\;,\quad\frac{\partial g}{\partial y}=\frac12\sqrt{\frac xy}\;,$$

so the error $e$ is

$$\begin{eqnarray} e &=& \sqrt{\left(\frac{\partial g}{\partial x}e_x\right)^2+\left(\frac{\partial g}{\partial y}e_y\right)^2}\\ &=& \frac12\sqrt{\frac yxe_x^2+\frac xye_y^2} \\ &=& \frac1{2g}\sqrt{(e_xy)^2+(e_yx)^2}\;. \end{eqnarray}$$

-
could you maybe provide a general equation for the geometric mean of n observations g(x1,x2,...xn)? –  Roey Angel Apr 3 '13 at 13:58
@Roey: The geometric mean is $\sqrt[n]{x_1\cdots x_n}$, so the derivatives are $$\frac{\partial g}{\partial x_i}=\frac1n\frac g{x_i}\;,$$ so the error is $$\sqrt{\left(\frac{\partial g}{\partial x_i}e_1\right)^2+\dotso+\left(\frac{\partial g}{\partial x}_ie_n\right)^2}=\frac gn\sqrt{\left(\frac{e_1}{x_1}\right)^2+\dotso+\left(\frac{e_n}{x_n}\right)^2}\;.‌​$$ –  joriki Apr 3 '13 at 14:35
Thanks! I assume you meant though: $(\frac{\partial g}{\partial xn}e_n\right)^2$ in the left hand side of the equation. –  Roey Angel Apr 3 '13 at 15:34
@Roey: I did, thanks, and likewise with index $1$ in the first term. (Your comment isn't rendering properly because you left off the \left at the beginning.) –  joriki Apr 3 '13 at 16:15