# How the error of the standard distribution is calculated in root?

Hi,

I wonder how the errors of the standard deviation of a histogram are calculated in root?

Say for example, in the following histogram (TH1D*h1 = new TH1D(“h1”,“Au_158.62_MeV”,101.,39.5,140.5) attached :

Here the estimation of the mean, error in the mean and the standard deviation are straightforward using the following equation :

But I don’t understand how the error in the standard deviation is calculated by root. Any help appreciated. Thank you.

Hi! Thanks for the question.

the uncertainty for the standard deviation is calculated as \sqrt{\frac{\sigma^2}{2n}}, which is the right estimator if the underlying distribution is Gaussian. For a general distribution this is not exact, because the right formula requires the 4th momentum of the distribution, which is not available to the histogram because of the binning.

I got this information from the source code:

This should probably also be written in the docs, so thanks for the reminder!

The variance error is given by

So to have the error on the square root of the variance you just need to evaluate

Edit:
But as said by jonas this formula is valid only for gaussian.

Thank you @jonas and @Dilicus for the clarification.
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9820168614387512, "perplexity": 419.11031898467184}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030336674.94/warc/CC-MAIN-20221001132802-20221001162802-00215.warc.gz"}