The correct "option" while fitting the efficiency?


This is a stupid question. I am trying to use TgraphAsymmErrors::BayesDivide to calculate the efficiency.

In the past, I just use

to do the fitting, which returned a not-bad fitting result.

After a round review, as it is said that the performance of the log likelihood would be always more powerful than the one of the chi2 method. So I tried the following things:

Which returns almost the same fitting results and higher fitting probability in some cases. My question is, is this the correct way to fit the efficiency? I am wondering how the error returned by BayesDivide is dealt with while using the option “LL” (or “L”) ?

And could you please recommend a reference which introduce how the log likelihood fitting is done for this case?

Thank you very much.

the correct way for fitting efficiency is via the class TBinomialEfficiencyFitter: … itter.html

which performs a log-likelihood fit of the efficiency using binomial errors.

Currently you cannot fit a TGraph with the log-likelihood (option L or LL), for this you get the same result.



Hi, Lorenzo,

Thank you very much for pointing this nice fitter to me.

I just try to calculate the acceptance (or efficiency) of the proper time after the impact parameter significance cuts. It seems to me that it is very hard for this fitter to coverage in this case.

You know, the efficiency function is something like:
Double_t AccpFit(Double_t *x, Double_t *par)
return par[2]*pow(par[0]*x[0],par[1])/(1 + pow(par[0]*x[0],par[1]) );

Another problem is that the htotal is just filled by the function of a Exponential convoluted with a Gaussian and normalized to the total events before the IPS cuts. So it is possible that some bin of the hpass would exceed the htotal…

Anyway, Bayesdivide works for me, maybe at this moment I just go back to the chi2 method.

Currently you cannot fit a TGraph with the log-likelihood (option L or LL), for this you get the same result. [/quote]
So the “same result” means they are not different from the chi2 method, or in this case ROOT just ignored the option “LL” and using a chi2 method? And the better fit probability is just fake? You know, I was thinking that “LL” is just what I want. -:slight_smile:

An improved Log likelihood fit in case of very low statistics and when bin contents are not integers. [/quote]

Thank you very much.


the class TBinomialEfficiencyFitter covers the case when you have binomial probabilities for the efficiencies. If you expect something else, you should construct your self the log-likelihood function and minimizes it using Minuit.

Otherwise for fitting a TGraph (and in your case a TGraphAsymmError) via TGraph::Fit only the chi2 method is used.
This is not optimal for efficiencies, since the result is statistically correct only when the points are gaussian distributed.

In your case ROOT just ignored the option “LL”.
For the available options for fitting a TGraph see: