I have a random variable $z$ for which I've calculated the sample mean $x = \frac{1}{n} \sum z_i$ and the sample standard deviation $s$. How can I calculate the standard deviation of $\frac{1,000,000}{x}$ ?

Edit: More concise and accurate question thanks to Matthew Gunn

Original verbose question:

I have a data set/sample of values and I calculate the average and standard deviation in the end. Now I have a calculated/derived value of this data set/sample that is calculated as $1000000/x$ (with $x$ being the average in the end). Now the question is, what is the standard deviation of my derived value?

I thought I could take the percentage of the standard deviation (standard_dev/average) and just multiple my derived average by it but that doesn't seem right... Is there any relationship between them at all or do I need to compute a new standard deviation by first converting my distribution to my derived/calculated value? (calculate $1000000/x$ for each value and then compute the standard deviation there)

Why do I need this? I want to graph the results with error bars, and I want to graph my derived value as well as the original value.

Further details/domain:

This is benchmarking. I measure run times in μs but want to also display/graph them in iterations per second ("how often could this be run within one second?" which is nice as higher -> better). And of course, I want to show error bars.

Here is an example of values I got (markdown tables don't work here, hope it's good enough):

| Name        | Iterations per Second | Average         | Standard Deviation | Standard Deviation Ratio | Median |
| map.flatten | 1451.6712445317       | 688.8612030905  | 173.9981946453     | 0.2525881758             | 583    |
| flat_map    | 911.7426322002        | 1096.8007469244 | 77.6401735316      | 0.0707878562             | 1056   |
  • $\begingroup$ This is all rather verbose and somewhat confusing. Is the question essentially, "I have a random variable $z$ for which I've calculated the sample mean $x = \frac{1}{n} \sum z_i $ and the sample standard deviation $s$. How can I calculate the standard deviation of $\frac{1,000,000}{x}$?" $\endgroup$ Jun 11, 2016 at 2:39
  • $\begingroup$ Yes I'll add that to the top. Sorry, math has been a while and correct terminology as never been my strong suit so I thought it better to be verbose than leave anything out :) Good summary, thank you. $\endgroup$
    – PragTob
    Jun 11, 2016 at 6:19

1 Answer 1


A note: reading about Jensen's inequality, $\mathop{\mathbb{E}}\left[1/x \right] \geqslant 1/\mathop{\mathbb{E}}\left[x \right]$ in your case, so I'm not sure it's a useful quantity. Check this thread.

Anyways, you have sample estimates of the mean and standard error of a variable and want to calculate the standard deviation of a transform of that variable.

$$\begin{align}\overline{y}=&\frac{1000000}{\overline{x}}\\SD(\overline y)=&\left|\left|SD(\overline x)\cdot\frac{\partial{\overline y}}{\partial{\overline x}}\right|\right|=\\=&1000000\space\cdot\space \frac{SD(\overline x)}{\overline x ^{2}}\end{align}$$

  • 1
    $\begingroup$ I'd drop the word "seems:" there's absolutely no question that $E[1/x] \geq 1 / E[x]$. And I assume you mean $SD(\bar{y})$ and $SD(\bar{x})$ on line two when you apply the delta method? And at the moment, I'm still a bit unclear too on what @PragTob wants... $\endgroup$ Jun 11, 2016 at 2:42
  • $\begingroup$ Thank you! And if basic math doesn't fail me, this is the same as $\frac{1000000}{\overline x}\space\cdot\space \frac{SD(\overline x)}{\overline x}$ which is what I did the past years :) Phew, am I glad I don't have to go back and correct all those error bars :) $\endgroup$
    – PragTob
    Jun 11, 2016 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.