Home | News | Documentation | Download

Query on Integral() option

Dear @couet, @Wile_E_Coyote,

I have fitted two histograms separately with three-Gaussians (fit1, fit2, fit3). The fits are done with “f(x) = p0 * exp(-0.5 * ((x-p1)/p2)^2)”. Now, I want to compare the ratio (fit1->Integral(bin1,bin2)/totalfit->Integral(bin1,bin2)) from those two histograms.

Is it OK? or I have to fit those histograms with the normalized Gaussian- “f(x) = p0 * exp(-0.5 * ((x-p1)/p2)^2)/(p2 *sqrt(2PI))”? Does the normalising factor (p2 *sqrt(2PI)) in the denominator of the fit function matter, in case of comparing such Integral ratios?

Please clear my confusion.

Hi,
The fact that you different form of your Gaussian (normalised or not) when fitting will change only the fit parameter definition. When computing ratio of integrals the result will be the same

Lorenzo

1 Like

Thanks @moneta,
I’m satisfied with your second sentence. As I was also seeing that the ratio is giving correct values even if I was using the Gaussian form without normalizing factor.

Now, I have further queries regarding your first sentence.
(1) Will the usage of the normalized form of Gaussian change the fit parameter (Height, Sigma, Mean) values?
(2) When is it necessary to use the normalized Gaussian form gausn?

You can play with the two macros given in the post linked below (the first one uses “gausn”, the second one “gaus”, the required “60Codata.txt” file is attached in another post in the same thread).

Dear @Wile_E_Coyote,

As I can see, only the front parameter value is changing in those two cases- “ gaus ” and “ gausn ” and that is obvious as “ gaus ” takes only the height at its front and “ gausn ” takes the scaling factor at its front. The mean and the sigma is not changing. But, the area under the curve if calculated, are coming to be same.

One can use anyone of these functions interchangeably.

Have I understood correctly?

Thanks.

Isn’t it obvious (e.g. from the first example macro) what it really represents?