Differences between the chi2 test and the pull method

Hello everyone and happy new year,
I’m recently using the “frame pull” construct which should allow me to monitor the goodness-of-fit for my binned fit.
The thing that is not clear to me is that, despite this analysis giving me bad results, with the chi2-test (Baker-Cousins method) I get a Prob.(Chi2) higher than 7%
I am attaching an image of what has been said:esempio2.pdf (85.1 KB)

Should i change pdf for curve description or stick to test results?

Thanks in advance for the reply

Hi,
Are you sure you are not using the residual Histogram (or that you are creating the pull histo wrt the full model) ?
From your fit you should have a 3-5 sigma pull plot, but you seem to plot the difference of data points to the fit curve here.
Have a look to the exanple macro here for the pull plot you might want to use for this.

1 Like

Hi @Emanuele94,

First of all Happy New Year.

Thanks, @RENATO_QUAGLIANI for providing an answer. For completeness, I am inviting @moneta to this thread just in case he can provide any other useful information.

Cheers,
J.

1 Like

First of all, thanks @RENATO_QUAGLIANI for your reply.
I’m sure I used the “pullHist ()” construct.
For completeness, I am attaching the code:

  RooPlot *framePull = x.frame();
  framePull->SetTitle("Pulls bin-by-bin");
  framePull->addObject((TObject*)frame->pullHist(), "p");
  framePull->SetMinimum(-10);
  framePull->SetMaximum(10);

  myC->Divide(0,2);
  myC->cd(2);
  gPad->SetPad(0.,0.,1.,0.3);
  framePull->Draw();

//x_min and x_max are the integration extremes of the fit
  TLine *line= new TLine(x_min,0.,x_max,0.);
  line->SetLineColor(2);
  line->Draw("SAME");
  myC->cd(1);
  gPad->SetPad(0.,0.3,1.,1.);
  frame->Draw();

@RENATO_QUAGLIANI and @jalopezg
I found the mistake and I apologize for not thinking about it on my own.
In practice on “frame” the last thing I am going to apply is one of the components:

model.plotOn (frame, Components (gauss_2), LineColor (46), LineStyle (kDashed));

Probably, instead of referring to the complete curve, the construct refers to the last one inserted in “frame”.
In this case, the last curve inserted is the Guassian below, which remains low both on the tails and on the central curve.
Thanks all the same for your interest

Hi @Emanuele94,

I am happy to hear that you found the solution to your issue! :slight_smile:

Cheers,
J.

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