Chi 2 for a weigthed dataset

Hi experts,

I performed an unbinned likelihood fit for a weighted RooDataSet but I have some problems when I try to get the fit probability.
It seems to get a negative value for ndf.

Any idea?

Thanks

Hi,

I’m not completely sure what you mean with the fit probability. Can you elaborate a bit more on what you’re doing?

Wouter

I performed an unbinned likelihood fit for a weighted RooDataSet.
When I try to get the chi 2
(Double_t chi2=frame->chiSquare(“model”,“data_unbinned”,npar)) and the probability (probFit = TMath::Prob(chi2*(nbins-npar),(nbins)) I have some problem.
For example it seems to get a negative value for ndf.

Thanks

Hi,

If you get a negative ndf that can only happen with a wrong combination
of nbin and npar. Where did you retrieve these numbers from?

Also when you call TMath::Prob(chi2*(nbins-npar),(nbins))
shouldn’t you also put nbins-npar in the 2nd argument?

Wouter

Sorry!
My mistake … i get a negative value for chi2 (Double_t chi2 = frame->chiSquare(“model”,“data_unbinned”,npar)).
Also I’m using SumW2Errors