# Standard error of the mean for root mean square of data

If I have a distribution of data, X, representing N samples taken during one measurement, then the mean square of X is $\bar{X^2} = \langle X^2 \rangle$, the variance of $X^2$, $\mathrm{var}(X^2)$ is $\langle\langle X^4 \rangle - \langle X^2 \rangle \rangle$, and the standard error of the mean square is $\sqrt{\frac{\mathrm{var}(X^2)}{N}}$.

Thus, the standard error of the mean square represents one standard deviation of the distribution that would be produced by repeating the measurement (taking N samples each time), assuming that $X^2$ is normally distributed with the variance of the original measurement.

What is the standard error of the quantity $\sqrt{\langle X^2 \rangle}$ (the standard error of the root mean square?)?

A rephrasing: assume Y is normally distributed with mean $\mu$ and variance $\sigma^2$. Define Z = $\sqrt{\frac{1}{N}\sum_1^N Y_i}$ What is the variance of Z?

• Do you mean to define $Z = \sqrt{\frac{1}{N}\sum_1^N Y_i^2}$? – Chris Taylor May 16 '11 at 17:04
• @chris taylor: sorry, here $Y_i \equiv X_i^2$, so no. The way I've written this is probably confusing. I started with rms, because that's familiar, but I'm doing the calculation with the variance of $X^2$, not the variance of $X$. My difficulty has nothing to do with the square part, actually, it's the square root that's giving me problems. – Marc May 16 '11 at 17:09

If $Y$ is normally distributed with mean $\mu$ and variance $\sigma^2$, $U = \frac{1}{N} \sum_1^N Y_i$ is normally distributed with mean $\mu$ and variance $\sigma^2/N$. Note that $P\{U < 0\} > 0$, so $Z$ will have complex values. Anyway, $E[|Z|] = \sqrt{\frac{N}{2\pi \sigma^2}} \int_{-\infty}^\infty \exp(-N(t-\mu)^2/(2 \sigma^2)) \sqrt{|t|}\, dt$. I doubt there is a closed form for this integral. $E[|Z|^2] = E|U| = \sqrt{\frac{2}{\pi N}} \sigma \exp(-\mu^2 N/(2 \sigma^2)) + \mu\, {\rm erf}(\mu \sqrt{N/2}/\sigma)$, and ${\rm Var}(Z) = E[|Z|^2] - E[|Z|]^2$.
• re: P{U < 0} > 0, you can define the expectation value by $E[f(U)] = \int_0^\infty f(U) p(U)$/$\int_0^\infty p(U)$. In practice, as N gets large, the variance gets small relative to the mean, so P{U < 0} -> 0. Also, the fact that p{U < 0} > 0 is an artifact of approximating the distribution of U as a gaussian using the central limit theorem. Since $Y_i > 0$ for all $Y_i$ ($Y_i \equiv X_i^2$ ), U is in fact strictly > 0. Thanks! – Marc May 16 '11 at 17:57
I'm going to answer the closely related question: if $X$ is normally distributed with mean $\mu$ and variance $\sigma^2$, what is the variance of $\sqrt{x}$ ?
To do this, I will assume that $\mu >> \sigma$, which is generally true for my original question of the standard error of the root mean square, assuming that the number of samples is large enough.
Then, define $y \equiv (x-\mu)/\sigma$. $E[y] = 0; E[y^2] = 1$ \begin{aligned} \sqrt{x} &=& \sqrt{\mu + \sigma y} \\ \sqrt{\frac{x}{\mu}} &=& \sqrt{1 + \frac{\sigma y}{\mu}} \\ \sqrt{\frac{x}{\mu}} &\approx& 1 + \frac{1}{2}\frac{\sigma y}{\mu}-\frac{1}{8}(\frac{\sigma y}{\mu})^2 \\ E[\sqrt{\frac{x}{\mu}}] &\approx& 1 + \frac{1}{2}\frac{\sigma}{\mu}E[y]-\frac{1}{8}(\frac{\sigma}{\mu})^2E[y^2] \\ &=& 1 - \frac{1}{8}(\frac{\sigma}{\mu})^2\\ \mathrm{var}(\sqrt{\frac{x}{\mu}}) &=& E[\frac{x}{\mu}] - E[\sqrt{\frac{x}{\mu}}]^2\\ &\approx& 1 - (1 - \frac{1}{8}(\frac{\sigma}{\mu})^2)^2\\ &\approx& \frac{1}{4}(\frac{\sigma}{\mu})^2\\ \mathrm{var}(\sqrt{x}) &=& \frac{1}{4}(\frac{\sigma^2}{\mu}) \end{aligned} So if the mean of x is $\mu$ and the standard deviation is $\sigma$, then the standard deviation of $\sqrt{x} \approx \frac{\sigma}{2 \sqrt{\mu}}$
In my original question, since the standard error of $X^2$ is $\sqrt{\frac{\mathrm{var}(X^2)}{N}}$, the standard error of $\sqrt{<X^2>}$ is therefore $\frac{\sqrt{\frac{\mathrm{var}(X^2)}{N}}}{2 \sqrt{<X^2>}}$