Minimizing the Poisson chi-square function

Hello,
I understand that in Igor the best values of the coefficients are the ones that minimize the value of Chi-square. Is it possible to use
Poisson chi-square function minimization
f(x)=2 \sum\limits_{i=1}^{N}(\mu_{i} - n_{i}ln\mu_{i})
instead of Chi-square minimization.

1) For a Poisson-distributed event-counting experiment, the data set is represented n_{i}, i = 1...N where each n_{i} is the measured number of events for bin i.
2) \mu_{i} is the fitted value for the point i.

Could anyone advice me on this matter.
Thanks and best regards,
Siva
I think what you're trying to describe is Maximum Likelihood fitting. Igor does not offer that.

For counting statistics, you can use normal least-squares fitting with a weighting wave equal to sqrt(counts). If you have bins with zero counts, you have to decide the correct approach- I believe a weight of 1 is commonly used.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Dear John,
Thank you for the reply. I found this term "Poisson chi-square function" at a course note from University of Florida.
Please have a look at the page 11 and 12 of the PDF document from this link below.
http://www.phys.ufl.edu/courses/phy4803L/group_I/gamma_spec/poisson.pdf
In this document an effective chi-square statistic is defined from the Poisson likelihood. It is claimed that the process of maximizing the Poisson likelihood is equivalent to minimizing the Poisson chi-square function. My knowledge in statistics is not sound enough to judge this claim. It will be very kind of you if you could please have a look at this method.
Cheers,
Siva
You should be able to use the gencurvefit XOP, with the MINF flag to fit with a Poisson cost function.
Cool that GenCurveFit does this!

It would also be possible to implement what that PDF describes using Igor's Optimize operation, though there will be some effort involved. And you would need to implement the process of optimizing with fixed and perturbed parameters in order to compute the errors. That might be done using a function that does the optimization using Optimize, then use that function with FindRoots to find where it increases the Poisson chi-square by 1.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
andyfaff wrote:
You should be able to use the gencurvefit XOP, with the MINF flag to fit with a Poisson cost function.


Hello Andrew, Thank you very much.
andyfaff wrote:
You should be able to use the gencurvefit XOP, with the MINF flag to fit with a Poisson cost function.


Hello Andrew, I managed to get it running with gencurvefit but its not giving the errors on the parameters (0 or NaN W_Sigma wave).

With FuncFit option its giving the errors on the parameters.
I tried No /MINF flag, /MINF=Chi2_CostFunc (given in gencurvefit help), /MINF=Chi2_Poisson1 and /MINF=Chi2_Poisson1 (I found two different Poisson cost functions in literature).
For NO /MINF flag and /MINF=Chi2_CostFunc cases W_sigma wave is filled with 0s.
/MINF=Chi2_Poisson1 and /MINF=Chi2 W_sigma wave is filled with NaN other than one column (=0) which was Held.

Limit waves are coef+/- 5%

It will be great if you could have a look at the experiment. Please find the attached file.

Cheers,
Siva

Command line used for different cases

•FuncFit/H="000000000000001"/NTHR=0 EEEGEEE coefs_HEMG DataY_counts[pcsr(A),pcsr(B)] /X=DataX_TOF /W=DataY_counts_err /I=1 /D /R

•Gencurvefit /hold=hold_HEMG /X=DataX_TOF /TOL=0.001 /R /L=100000 /W=DataY_counts_err HyperEMG,DataY_counts[pcsr(A),pcsr(B)] ,coefs_HEMG,"",limitsHEMG

•Gencurvefit /hold=hold_HEMG /X=DataX_TOF /MINF=Chi2_CostFunc /TOL=0.001 /R /L=100000 /W=DataY_counts_err HyperEMG,DataY_counts[pcsr(A),pcsr(B)] ,coefs_HEMG,"",limitsHEMG

•Gencurvefit /hold=hold_HEMG /X=DataX_TOF /MINF=Poisson_CostFunc1 /TOL=0.0001 /R /L=100000 /W=DataY_counts_err HyperEMG,DataY_counts[pcsr(A),pcsr(B)] ,coefs_HEMG,"",limitsHEMG

•Gencurvefit /hold=hold_HEMG /X=DataX_TOF /MINF=Poisson_CostFunc2 /TOL=0.0001 /R /L=100000 /W=DataY_counts_err HyperEMG,DataY_counts[pcsr(A),pcsr(B)] ,coefs_HEMG,"",limitsHEMG
Gen_curve_fit_trial.pxp (880.63 KB)