# Meaning/Significance of RMS

**URL:** <https://root-forum.cern.ch/t/meaning-significance-of-rms/6728>\
**Category:** ROOT\
**Created:** [June 25, 2008, 5:53pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728 "2008-06-25T17:53:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fig](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/b9bd4f/32.png) [@fig](https://root-forum.cern.ch/u/fig)\
**Post date:** [June 25, 2008, 5:53pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/1 "2008-06-25T17:53:13Z")

</div>

I know that the rms value in the Statistics box stands for the root mean square, and I know the formula for rms. But, I am not sure what it means when the Statistics box displays RMSx and RMSy. Does it represent the rms for each bin in x,y? I also read that in ROOT, the RMS actually is the standard deviation [http://root.cern.ch/root/html/TH1.html#TH1:GetRMS](http://root.cern.ch/root/html/TH1.html#TH1:GetRMS). Is this true? Any explanation would be greatly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [June 26, 2008, 7:20am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/2 "2008-06-26T07:20:53Z")

</div>

What do you find missing at: [root.cern.ch/root/html520/TH1.html#TH1:GetRMS](http://root.cern.ch/root/html520/TH1.html#TH1:GetRMS) ?

for dimensions \>= 1 RMSx is the standard deviation along X  
for dimensions \>= 2 RMSy is the standard deviation along Y  
for dimensions \>=3 RMSz is the standard deviation along Z

Rene

---

<div class="post-metadata">

**Author:** ![cplager](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@cplager](https://root-forum.cern.ch/u/cplager)\
**Post date:** [June 26, 2008, 1:23pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/3 "2008-06-26T13:23:48Z")

</div>

> [@fig](#):
>
> I also read that in ROOT, the RMS actually is the standard deviation [http://root.cern.ch/root/html/TH1.html#TH1:GetRMS](http://root.cern.ch/root/html/TH1.html#TH1:GetRMS). Is this true?

Yes, it is. See [http://mathworld.wolfram.com/Root-Mean-Square.html](http://mathworld.wolfram.com/Root-Mean-Square.html), for example.

> [@](#):
>
> Physical scientists often use the term root-mean-square as a synonym for standard deviation when they refer to the square root of the mean squared deviation of a signal from a given baseline or fit.

Cheers,  
Charles

---

<div class="post-metadata">

**Author:** ![fig](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/b9bd4f/32.png) [@fig](https://root-forum.cern.ch/u/fig)\
**Post date:** [June 26, 2008, 6:13pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/4 "2008-06-26T18:13:24Z")

</div>

Thanks for the explanation.

---

<div class="post-metadata">

**Author:** ![perthi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@perthi](https://root-forum.cern.ch/u/perthi)\
**Post date:** [August 21, 2008, 10:52pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/5 "2008-08-21T22:52:56Z")

</div>

In general the rms and the std is not the same.  
The rms is commonly used as an estimator for the std because its often the  
only readily availalable quantity (it can be easily calculated from the data).

The rms is an unbiased estimator of the std  
If the underlying distribution is gaussian and systematic errors such as ADC quantization errors are small compared too the signal amplitude, but  
it can lead too terribly wrong results if these two requiremnts are not satisfied.

---

<div class="post-metadata">

**Author:** ![berder](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a587f6/32.png) [@berder](https://root-forum.cern.ch/u/berder)\
**Post date:** [February 26, 2010, 5:21pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/6 "2010-02-26T17:21:36Z")

</div>

This is probably not a big deal for most ROOT users, who probably deal with large samples, but wouldn’t it be more wise to use (n-1) instead of n in the standard deviation computation ?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [May 19, 2010, 9:59am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/7 "2010-05-19T09:59:00Z")

</div>

Hi,  
I am reluctant to change this, since these formula (using biased estimator for the standard deviation) have been used since a long time.  
Also I remind you that the biased estimator for the standard deviation that we use in ROOT (TMath::RMS, TH1::GetRMS, tc…) is more efficient, i.e. it is having a smaller MSE (Mean squared error) compared to the unbiased one. We could then debate what is the better estimator…

Lorenzo

---

<div class="post-metadata">

**Author:** ![vsavinov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/439d5e/32.png) [@vsavinov](https://root-forum.cern.ch/u/vsavinov)\
**Post date:** [June 28, 2010, 5:50am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/8 "2010-06-28T05:50:19Z")

</div>

The original post was asking a question if MSE on \sigma, i.e. “\sigma\_\sigma” is properly evaluated in ROOT assuming Gaussian statistics. I removed the post to avoid future confusion, because the answer is “yes”, \sigma\_\sigma = \sigma/\sqrt{2 N}, where \sigma = \sqrt(\hat{Var(x)}) as R. Barlow’s book explains very clearly on p.79 (this is for the biased estimator of Var(x), for the unbiased one it would be \sigma/\sqrt{2 (N-1)}).

---

<div class="post-metadata">

**Author:** ![leszczo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/a6a055/32.png) [@leszczo](https://root-forum.cern.ch/u/leszczo)\
**Post date:** [January 10, 2012, 12:55pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/9 "2012-01-10T12:55:24Z")

</div>

hi,  
What if I want to calculate RMS (no standard deviation), do I have to do it on my own?

cheers

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [January 11, 2012, 10:29am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/10 "2012-01-11T10:29:45Z")

</div>

HI,

Yes if you want root mean square of an Histogram and not the standard deviation you need to compute yourself.  
It is a trivial operation from the standard deviation and the mean

```auto
double rootMeanSquare = std::sqrt ( h1->GetMean()*h1->GetMean() + h1->GetRMS()*h1->GetRMS() );
```

Lorenzo

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [October 8, 2012, 11:33am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/11 "2012-10-08T11:33:54Z")

</div>

Hi there,

In this regard, it would make life much easier not to have to warn any new colleagues (not only statisticians or signal processing engineers but also biologists or any other scientists…)

So how about

[ul][_] Adding a function allowing to change the “RMS label” displayed [/_]  
Changes to be made to TStyle.h

`
TString fStatRMSlabel ;
void SetStatRMSlabel(const char* label="RMS") {fStatRMSlabel = label;}
const char* GetStatRMSlabel() const {return fStatRMSlabel.Data();}
`Changes to be made to THistPainter::THistPainter()

`
gStringRMS = gEnv->GetValue("Hist.Stats.RMS", gStyle->GetStatRMSlabel());
gStringRMSX = gEnv->GetValue("Hist.Stats.RMSX", TString::Format("%s x",gStyle->GetStatRMSlabel()).Data());
gStringRMSY = gEnv->GetValue("Hist.Stats.RMSY", TString::Format("%s y",gStyle->GetStatRMSlabel()).Data());
gStringRMSZ = gEnv->GetValue("Hist.Stats.RMSZ", TString::Format("%s z",gStyle->GetStatRMSlabel()).Data());
`Usage (rootlogon)`gStyle->SetStatRMSlabel("Std Dev") ;`  
[/ul]  
[ul][_] Creating “redirect” functions for coders e.g. [/_]

```auto
Double_t TH1::GetStdDev(Int_t axis) const
{
   return ( GetRMS(axis) ) ;
}
Double_t TH1::GetStdDevError(Int_t axis) const
{
   return ( GetRMSError(axis) ) ;
}
```

[/ul]  
Cheers,  
Z

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [November 4, 2012, 9:43pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/12 "2012-11-04T21:43:24Z")

</div>

[quote]gStringRMS = gEnv-\>GetValue(“Hist.Stats.RMS”, gStyle-\>GetStatRMSlabel());  
gStringRMSX = gEnv-\>GetValue(“Hist.Stats.RMSX”, TString::Format("%s x",gStyle-\>GetStatRMSlabel()).Data());  
gStringRMSY = gEnv-\>GetValue(“Hist.Stats.RMSY”, TString::Format("%s y",gStyle-\>GetStatRMSlabel()).Data());  
gStringRMSZ = gEnv-\>GetValue(“Hist.Stats.RMSZ”, TString::Format("%s z",gStyle-\>GetStatRMSlabel()).Data());[/quote]Rubbish! 😊  
Please check rmslabel.tgz (svn diff against trunk revision 47030)

[quote]Double\_t TH1::GetStdDev(Int\_t axis) const { return ( GetRMS(axis) ) ; }  
Double\_t TH1::GetStdDevError(Int\_t axis) const { return ( GetRMSError(axis) ) ; }[/quote]Clumsy and incomplete!  
Please check stddevfunctions.tgz (svn diff against trunk revision 47030)

Would it be possible to commit these changes to the trunk?

TIA,  
Z  
[stddevfunctions.tgz](https://root-forum.cern.ch/uploads/default/original/2X/b/b3545cd60e843a2c56400dc67586632898b0f0be.tgz) (698 Bytes)  
[rmslabel.tgz](https://root-forum.cern.ch/uploads/default/original/2X/d/d8cbf9cd539edb4cd986326a7084fdd5fea015e6.tgz) (1019 Bytes)

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [May 23, 2013, 6:46am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/13 "2013-05-23T06:46:50Z")

</div>

Any restrictions?  
Cheers,  
Z

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [May 30, 2013, 7:57pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/14 "2013-05-30T19:57:48Z")

</div>

Knock, knock…  
Another try (diff against current trunk (rev. 6e3d420f7cf1f95c5ee1c2a7ee204b4f3a228f52))  
for the visual part only (rmslabel.tgz)

Usage: `gStyle->SetStatRMSlabel("Std Dev") ;`  
Could someone please commit this ultra light transparent feature to the trunk?  
Cheers,  
Z  
[THistPainter.cxx.diff](https://root-forum.cern.ch/uploads/default/original/2X/b/bdd25c3640ad95b8581b8453e1e4c76c95199a6c.diff) (1.26 KB)  
[TStyle.h.diff](https://root-forum.cern.ch/uploads/default/original/2X/c/c002148fb2a1ef5d7550168f7ab3e3e3aa6a32f3.diff) (1.63 KB)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 31, 2013, 1:44pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/15 "2013-05-31T13:44:47Z")

</div>

sorry I missed that… let me see.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 31, 2013, 1:51pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/16 "2013-05-31T13:51:29Z")

</div>

I think you are reinventing the wheel … simply set the string you need in $ROOTSYS/etc/system.rootrc

```auto
# Default statistics parameters names.
Hist.Stats.Entries: Entries
Hist.Stats.Mean: Mean
Hist.Stats.MeanX: Mean x
Hist.Stats.MeanY: Mean y
Hist.Stats.MeanZ: Mean z
Hist.Stats.RMS: RMS
Hist.Stats.RMSX: RMS x
Hist.Stats.RMSY: RMS y
Hist.Stats.RMSZ: RMS z
Hist.Stats.Underflow: Underflow
Hist.Stats.Overflow: Overflow
Hist.Stats.Integral: Integral
Hist.Stats.Skewness: Skewness
Hist.Stats.SkewnessX: Skewness x
Hist.Stats.SkewnessY: Skewness y
Hist.Stats.SkewnessZ: Skewness z
Hist.Stats.Kurtosis: Kurtosis
Hist.Stats.KurtosisX: Kurtosis x
Hist.Stats.KurtosisY: Kurtosis y
Hist.Stats.KurtosisZ: Kurtosis z
```

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [June 1, 2013, 12:24am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/17 "2013-06-01T00:24:02Z")

</div>

This was my first attempt indeed 😉  
But as I remember it, it was not a viable solution since at that time this file got overwritten each time I was recompiling Root (this is no more the case fortunately 🙂)  
On a general basis I don’t think one should need to fiddle with config files any time (s)he wants to install a new version of Root. According to me this is what the rootlogon.C is for.  
More importantly

- the choice of the label must be left to the end user which is not possible if several persons use the same Root build (what if two users want to set different names at the same time?)
- you may just not have the right to modify this file  
So I guess the best solution is to use a TStyle method.

By the way I forgot a file last time… ☹  
Attached’s the full patch 😃

Cheers,  
Z  
[THistPainter.cxx.diff](https://root-forum.cern.ch/uploads/default/original/2X/c/cebaec2a85b6d999ed6afa2e91495373f1e9fed7.diff) (1.24 KB)  
[TStyle.cxx.diff](https://root-forum.cern.ch/uploads/default/original/2X/1/114574a7a6ede24e20057d18fbe06b186037fa4c.diff) (1.51 KB)  
[TStyle.h.diff](https://root-forum.cern.ch/uploads/default/original/2X/0/0b0f35043c4628eed5e32f95466bb3afad7944f0.diff) (1.68 KB)

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [June 7, 2013, 11:07am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/18 "2013-06-07T11:07:22Z")

</div>

Hi,

For consistency, here’s the patch (git diff against trunk rev 15e65321c9a587ccda95e3847097040ff4b79dfd) that takes into account all stat labels:

`gStyle->SetStatLabelEntries () ;
gStyle->SetStatLabelMean () ;
gStyle->SetStatLabelRMS ("Stdev") ;
gStyle->SetStatLabelUnderflow() ;
gStyle->SetStatLabelOverflow () ;
gStyle->SetStatLabelIntegral () ;
gStyle->SetStatLabelSkewness () ;
gStyle->SetStatLabelKurtosis () ;`  
It cancels and replaces the previous one.  
(Note the rootname has changed: xStatRMSLabel() -\> xStatLabelRMS())

Cheers,  
Z  
[THistPainter.cxx.3.diff](https://root-forum.cern.ch/uploads/default/original/2X/8/85c13dd28bca5d3566312cc08b8f3a6ac2f2e10a.diff) (3.45 KB)  
[TStyle.cxx.3.diff](https://root-forum.cern.ch/uploads/default/original/2X/5/58f534f81ada2d0261c2ef27eaf82d3ea0d4f660.diff) (2.89 KB)  
[TStyle.h.3.diff](https://root-forum.cern.ch/uploads/default/original/2X/3/376dcf8ca90085bb56e81b4bd019b35cbd089212.diff) (3.63 KB)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 10, 2013, 6:52am UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/19 "2013-06-10T06:52:32Z")

</div>

I do not think we can have an other way of changing these labels.  
We will stick with the technique we have now.  
There is no other examples of parameters you can set in two ways like that …  
It would be rather confusing. Plus … which one will have the priority ???

---

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [June 10, 2013, 5:47pm UTC](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728/20 "2013-06-10T17:47:56Z")

</div>

Here’s the point I missed so far:  
[root.cern.ch/download/doc/primer … t-start-up](http://root.cern.ch/download/doc/primer/ROOTPrimer.html#configure-root-at-start-up)  
namely, any user can override the file $ROOTSYS/etc/system.rootrc (which may be locked) by creating its own personal config file and calling it “.rootrc”.  
Pb solved! 😉  
Cheers,  
Z

[Next page](https://root-forum.cern.ch/t/meaning-significance-of-rms/6728.md?page=2)
