Question about TMath::Poisson(double,double)

From: Datao Gong <dtgong_at_physics.umn.edu>
Date: Sat, 9 Apr 2005 12:19:08 -0500 (CDT)


Hi,
I intergral Poisson distribution from 0 to a large number and i expected to get 1. but it is not, especially when the mean of Poisson distribution is small number.

Here is the small test code:
void test()
{

    double sum(0);
    double step(0.0001);
    double range(100);
    for(int i = 0; i < range/step; i++){

       double x = (i+0.5)*step;
       sum+=TMath::Poisson(x,1)*step;

    }
    cout<<sum<<endl;
}

I get 0.83 for this program. Is there something wrong?

Thanks

Datao Gong Received on Sat Apr 09 2005 - 19:19:17 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET