How to do extended unbinned ML fit to weighted dataset

Dear experts,

I wonder how RooFit handles the extended unbinned likelihood fit to weighted dataset. Can you please provide me any math equations?

I have a small macro attached.
fit.C (1.9 KB)

I tried to perform fit to the unbinned dataset.

The parameter estimations seems not taking into any weights and total biased. I wonder if I can get the similar output as TF1 to a weighted histogram.

Thank you in advance!

I’m sure @jonas or @moneta can answer to this question

Hi!

You are not filling the RooDataSet correctly. The RooDataSet::weight() function takes the weight as a second parameter. The RooArgSet that you pass is only for the non-weight variables. I your code that would look like this:

ds.add(argSet, 1./threshold);

From the mathematics, there is nothing special going on in the weighted fits. The log-likelihoods are just weighted by the weights and the observed number of events for the extended term is the sum of weights and not just the number of entries.

For some more advanced options related to the weights, you can check out the documentation of RooAbsPdf::fitTo, in particular the SumW2Error() and AsymptoticError() options. Let me know if you have further questions about this.

Hope that helps!
Jonas

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