Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Pretty basic question I'm sure:

I have a 100 histograms, they are all created from randomly sampling the same data 100 times.

Now, I want to show the 'average histogram' with markers at +1 standard deviation.

I know how to compute the average - just add bin-wise and divide by the number of histograms.

But for the standard deviation: do I use all the bin-heights from all 100 histograms to calculate the standard deviation, or do I use the bin-heights from my 'average histogram' to calculate it?


share|cite|improve this question
up vote 0 down vote accepted

The (sample) standard deviation is defined as $\hat{\sigma} =\sqrt{\overline{x^2}-\overline{x}^2}$. Normally you would calculate the average and standard deviation for each bin. For each bin, $\overline{x}$ is the value in that bin in the average histogram, while $\overline{x^2}$ is the average of the squares of the values in that bin over all the histograms.

share|cite|improve this answer
Please double-check your definition of $\sigma$. – cardinal Aug 20 '11 at 23:50
I have taken the liberty of correcting a couple of typos in this answer which might have been confusing. – cardinal Aug 22 '11 at 12:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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