Roofit Unbinned VS Binned fit


I am using some Roofit to fit my data.
By default I was using an unbinned fit and everything seems ok except that a single fit takes about 5/6 minutes
to finish (and this for toys studies is not optimal for me…).
I tried with a binned fit. given a dataset

RooDataSet data_b("data_b","data_b",RooArgSet(recoJetMass,weight),RooFit::WeightVar("weight"));

I created a

RooDataHist hist_b("hist_b","hist_b",RooArgList(recoJetMass),data_b);

and fit with

RooFitResult *fitresult=model.fitTo(hist_b,RooFit::Strategy(1),RooFit::Save(true),RooFit::Minos(false));

I have 8 free parameters and the statistic is pretty large (45 bins. the less populated bin has ~2000 entries)
and so I expected to not see large difference between binned and unbinned fit result.
But I observe that the two fits converge on two different minima: the binned fit gets the “worst” minimum
( much larger chi2/ndf). If I set the initial parameters of the binned fit identical to the parameters obtained from unbinned fit it still moves into the other minimum. This is a bit puzzling.

is there something wrong in what I am doing?



You should try to increase the number of bins, it could be they are too large. if younobserve still this problem with much more bins, p.eqse send me the workspace with model and dataset, so I can look at it

Best regards


thank you. Increasing the binning improves a lot.
I will try to see if it actually gets to the same minimum.