Hi Lorenzo,
I used ROOT as well as ROOFIT
In ROOT i used chi2, Log-likelihood fit (uses bin center) and log-likelihood with bin integration…
all the above three cases i get almost same answer for my fitting parameter… (by the way i am using exponential function
like [0]*exp(-x/[1] ).
This is how i fit the three different way my histogram:
TF1 decaym(“decaym”,"[0]*exp(-x/[1])", 0., 10.);
h->Fit(“decaym”); // default fit - chi2 fit
//h->Fit(“decaym”,“L”); // log likelihood fit
//h->Fit(“decaym”,“LI”); // log likelihood fit with bin integration, rather than using bin centre.
On the contrary, when i use roofit to fit the same histogram with roo-decay model (which is also exponential) with delta function resolution,
using binned chi2 fit: i get same as in root
using binned likelihood fit: i get 5% different in central value of my fitting parameter…why ?
This is how i do the fit in roofit
RooTruthModel tm(“tm”,"",gt);
RooDecay* decaym =new RooDecay(“decaym”,"", x , tau, tm,RooDecay::SingleSided);
for chi2-fit i use:
RooChi2Var chi2(“chi2”,“chi2”,decaym, data) ;
RooMinuit m(chi2) ;
m.migrad() ;
m.hesse() ;
but for likelihood fit:
RooFitResult* fitr=decaym.fitTo(data); // for likelihood fit
Is there something i am missing…why roofit likelihood method gives me complete different answer than other 4 methods (3 methods using root and chi-2 method in roofit) ?
If you want i can provide you the root file and code…
-Sanjay