Simultaneous Fit of Binned and Unbinned dataset

Dear experts,
In our analysis , we want to perform a fit a simultaneus fit ( sharing of parameters ) between binned and unbinnned datasets.

So far our strategy is to have the following :

nll1 = DataHist1->CreateNLL( pdf1) ;
nll2 = DataSet2->CreateNLL(pdf2); with pdf1 having as observabe obs1 and dependence to PARSHARED,
while pdf2 has as observable obs2 and dependence eto PARSHARED.

What i do to get a simultaneous fit is to minimize the RooAddition of nll1 and nll2.

Now, i wonder if the fact this can be done only in this way inside RooFit is somehow hiding the fact what i am doing is wrong.

Any suggestion is welcome.

Thanks in advance.

Renato

@StephanH any suggestions for Renato?

Hello Renato,

Adding log-likelihoods looks OK to me.

If you only want to construct a single log-likelihood, another option would be to construct a simultaneous PDF of the two pdfs, and make a combined dataset of the binned and unbinned data.
You can do this by making both datasets unbinned, and combining them as follows:

   RooCategory samples("samples", "samples");
   [... add category names here ...]

   RooArgSet datasetVars(x, y, weight, sample);
   std::map<std::string, RooDataSet*> sampleMap;
   sampleMap["xSampleName"] = &dataX;
   sampleMap["ySampleName"] = &dataY;
   
   RooDataSet combData("combData", "combined data", datasetVars, Index(sample), WeightVar(weight), Import(sampleMap));

Check out this constructor to see how you combine datasets from different categories:
https://root.cern.ch/doc/master/classRooDataSet.html#aeea71f616bd2cc6743f6869d31a4dbd5

To make the dataset unbinned, use the bin center of the histogram as x value and set the weight of the event to the bin content. You will get the exact same probabilities, but the “shape” of the dataset looks different.

A similar approach is being discussed in

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.