# How to calculate effective sigma?

**URL:** <https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472>\
**Category:** Newbie\
**Tags:** roofit\
**Created:** [May 18, 2020, 9:09am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472 "2020-05-18T09:09:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahoos](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sahoos](https://root-forum.cern.ch/u/sahoos)\
**Post date:** [May 18, 2020, 9:09am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/1 "2020-05-18T09:09:35Z")

</div>

Dear experts,

I have fitted the data sets with two Gaussian PDFs in roofit.

RooRealVar mean(“mean”,“mean”,1.777,1.75,1.79);  
RooRealVar sigma1(“sigma1”,“sigma1”,0.00,0.0,0.1);  
RooGaussian signal1(“signal1”,“signal1”,x,mean,sigma1);

RooRealVar sigma2(“sigma2”,“sigma2”,0.01,0.0,0.2);  
RooGaussian signal2(“signal2”,“signal2”,x,mean,sigma2);

RooRealVar sfrac(“sfrac”,“Area fraction”,0.5,0.0 ,1.0);  
RooAddPdf signal(“signal”,“model”,RooArgList(signal1,signal2),sfrac);

signal.fitTo(\*data);

After the fit, there are two sigmas found as a result. Here my question is what will be the ideal way to calculate the effective uncertainty from the fit.

I am thinking to calculate the, Effective sigma = sfrac_sigma1 + (1-sfrac)sigma2 here in roofit. Please let me know someone whether the above way is correct or they will be added in quadrature Effective sigma = sqrt( sfrac(sigma1)^2 + (1-sfrac)_(sigma2)^2 ). I am somehow confused about this now.

Thanks in advance.

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<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 20, 2020, 12:27pm UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/2 "2020-05-20T12:27:32Z")

</div>

Hi,

I have not understood what you mean with effective sigma and what is its definition. Please clarify it…

---

<div class="post-metadata">

**Author:** ![sahoos](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sahoos](https://root-forum.cern.ch/u/sahoos)\
**Post date:** [May 20, 2020, 4:15pm UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/3 "2020-05-20T16:15:01Z")

</div>

Hi @moneta

I want to estimate the resolution from the distribution. So I fit the data sets with two Gaussian PDF. So I just wanted to know what will be the correct way to get the resolution from the fit since there are two sigmas after the fit.

If the fit is performed by one Gauusian PDF then I could take easily the sigma after fitting as the resolution.  
I hope it is clear now. Please let me know if it is still not clear.

Thanks

---

<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 22, 2020, 8:57am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/4 "2020-05-22T08:57:20Z")

</div>

Hi,  
If you want the standard deviation of the distribution which is given by the sum of the two gaussian, if the two gaussian have the same mean, the result is :  
sigma^2 = frac \* sigma1^2 + (1.-frac) \* sigma2^2.

It is easy to proof by computing the first and second momentum of the total distribution (your signal model).

Lorenzo

---

<div class="post-metadata">

**Author:** ![sahoos](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sahoos](https://root-forum.cern.ch/u/sahoos)\
**Post date:** [May 22, 2020, 10:48am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/5 "2020-05-22T10:48:01Z")

</div>

Hi @moneta

Thank You! Yes, the two Gaussian have the same mean during fitting to data.

Now I just wanted to sure that is it sigma^2 = frac \* sigma1^2 + (frac-1) \* sigma2^2 or  
sigma^2 = frac \* sigma1^2 + (1-frac) \* sigma2^2 ?  
Or that is a typo? If possible for you , can you please share the proof or any kind of link for that.

Thank You So much!

---

<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 22, 2020, 11:45am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/6 "2020-05-22T11:45:11Z")

</div>

Sorry, it was a typo. I have corrected it now

---

<div class="post-metadata">

**Author:** ![sahoos](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@sahoos](https://root-forum.cern.ch/u/sahoos)\
**Post date:** [May 22, 2020, 11:51am UTC](https://root-forum.cern.ch/t/how-to-calculate-effective-sigma/39472/7 "2020-05-22T11:51:38Z")

</div>

Thank You Lorenzo. Now I understand and clear.
