How to access chi-squared/NDF after ->chi2FitTo()?

Hi experts,

I have a RooAddPDF and want to fit it to a RooDataHist. Currently, I use the default maximum likelihood fit by doing the following:

some_rooaddpdf.fitTo(some_roodatahist, Range(fitting_lowerbound,fitting_higherbound));

Now I want to do the same, but with a chi-squared fit instead. I guess I would have to use ->chi2FitTo() analogous to before, like this:

some_rooaddpdf.chi2FitTo(some_roodatahist, Range(fitting_lowerbound,fitting_higherbound));

Two questions:

  1. I am a bit confused by the documentation of chi2FitTo(). Could someone elaborate on the option ‘Extended’?

  2. How do I access the goodness-of-fit value, which is ‘chi-squared/NDF’? I know there is a tutorial showing how to calculate it when using a frame, but is there no way of simply accessing it when the chi-square fit has just been done? Also, the documentation of TFitResult does not show how to access it.

Any ideas? Thanks in advance!


Let me comment about the Extended option. This is a standard way to perform fits, in this context the Chi2 equivalent of the Extended Likelihood fit. You find a lot of documentation about this, let me just link this one by Luis Lyons. In a nutshell it’s a way in which you can fit the normalisation of your pdf.

It should be easy for you to derive the reduced chi2, but I add in the loop @moneta and @jonas in case they have suggestions.


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