for the bin with zero event, the error bar will be shown with one in default. How to close this with command in program?
I used RooFitResult* r = sum.fitTo(*data,Minos(kFALSE),Save(kTRUE),Extended()); to fit a distribution, the fit is SUCCESSFULLY and the fit gives me a value of FCN. Then I used
Hi, all. I can confirm the second problem.
I have tried the two ways of fitting (i.e. using the fitTo() method and using RooNLLVar and RooMinuit explicitly) on several data sets and PDFs, the results look alike for the estimated parameter values, the fitting status are all OK, but the FCN varies greatly. The FCN value from fitTo() are always smaller though.
Can anybody explain why this is happenning and which way is correct? Is that possiblly because there are some special optimization algorithm apllied in fitTo() method?
For the NLL value difference, my guess is that it may be caused by an overall normalization factor (assuming that the fitting results are the same). Usually we don’t care about the absolute value of the NLL, but if you want to use it to measure the goodness of the fitting, please make sure you would not have the problem already discovered, e.g.: http://www-cdf.fnal.gov/publications/cdf5639_goodnessoffitv2.ps.gz
or use the createNLL method of RooAbsPdf to make the likelihood for you
RooAbsReal* = sum.createNll(*data,Extended()) ;
which is recommended because the accepts same options as fitTo() that
control the construction of the likelihood (thus guaranteeing a consistent result).