Re: chi2/NDF from max. likelihood include bins with 0 counts.

From: Wei Xie <wxie_at_purdue.edu>
Date: Sat, 18 Dec 2010 10:46:49 -0500


A related question. When doing the Likelihood fit, how the uncertainty of the 0-counts bin is calculated. Does it assume it's a Poisson with a mean from the interpolation of neighboring bins?

Thanks
--Wei

On 12/17/2010 7:14 PM, Wei Xie wrote:
> When calculating the chi2/NDF, empty bin is taken into account in the
> max.likelihood method. Least-chi2 option don't have this problem. The
> following macro demonstrate this. I tried this in ROOT 5.22. 5.27.
> They shows the same results. Is this because I didn't use it properly
> or this is a bug? If this is not a bug, how to do the max. likelihood
> fit without taking into account the empty bins?
>
> Thanks
> --Wei
>
> {
> h = new TH1F("h", "", 100, -10, 10);
> for(int i = 0; i<1000; i++) {
> float a = gRandom->Gaus(0, 1);
> h->Fill(a);
> }
>
> h->Sumw2();
>
> h->Scale(0.5);
>
> TH1F *h0 = (TH1F*)h->Clone();
> h0->SetName("h0");
> TH1F *h1 = (TH1F*)h->Clone();
> h1->SetName("h1");
> TH1F *h2 = (TH1F*)h->Clone();
> h2->SetName("h2");
>
> c1 = new TCanvas("c1", "", 900, 900);
> c1->Divide(2, 2);
>
> gStyle->SetOptFit(1);
>
> c1->cd(1);
> h->Fit("gaus", "L", "", -3, 3);
> c1->cd(2);
> h0->Fit("gaus", "L", "", -10, 10);
>
> c1->cd(3);
> h1->Fit("gaus", "", "", -3, 3);
> c1->cd(4);
> h2->Fit("gaus", "", "", -10, 10);
> }
>

-- 
Dept. of Physics, Purdue Univ.
525 Northwestern Ave., West Lafayette, IN 47907
Tel: 765-494-8743, Fax: 765-494-0706
Received on Sat Dec 18 2010 - 17:02:48 CET

This archive was generated by hypermail 2.2.0 : Mon Dec 20 2010 - 17:50:02 CET