How pdfs are evaluated when fitting?

Hi,

When one fits to a histogram using pdf->fitTO(data) the pdf has to be evaluated to give another histogram that with the first one gives a likelihood that has to be maximized. My question is how is the pdf evaluated? Is it evaluated as the value at the center of the bin or as the integral over the bin?

I am doing fits building my own likelihood and my fits look unbiased, but when i try it with roostats, i get biased fits. I am using the generated toys that roostats used, I save them with genData from RooMCStudy, so I know the generation is right.

Hi,

The pdf is evaluated at the bin centre, which is the value stored in the RooDataHist class

Lorenzo

Hi,

Why do you do that? If the function changes very fast you would have to increase the number of bins to make the center more or less agree with the function in the bin, but if I need to keep a given binning, choosing the center should be a problem.

How can I rather use the integral?

This is not yet supported in Roofit. You should use then the normal fitting code in ROOT which supports this
(TH1::Fit with option “I”) or use more bins or an unbinned fit

Best Regards

Lorenzo

Hi,

I don’t really want to do just do a fit. I have an object in RooAbsPdf that I want to use to set limits with the asymptotic calculator, the problem with the way how the pdf is sampled should affect these limits? It certainly affects the pulls that I get with RooMCStudy. Now I see that the problem is not my model but the way how the fit is done.

Hi,

There is no problem for generating toy data from the pdf. The problem is instead of a bias in the binned likelihood fit you are doing.
See this open issue sft.its.cern.ch/jira/browse/ROOT-3874

Can you not increase the number of bins ? If your statistics is small this bias is anyway negligible compared to the statistical error from the fit.

Lorenzo

Hi,

I think a workaround for this is to define the pdf as made of steps or bins and these bins have a bin content that one can get by integrating in the same code the function. So that the fit is done taking the pdf value in the middle point of the bin, but the pdf is constant in the bin and equal to the integral of the function one starts with

This is implemented in a very simple and small piece of code in root.cern.ch/phpBB3/viewtopic.php?f=15&t=18777 that can be easily adapted to a particular users need. I hope this helps people out there.

Hi,

Is this problem solved in ROOT6?