Re: Question about TMath::Poisson(double,double)

From: Stanislav Nesterov <Stanislav.Nesterov_at_pnpi.spb.ru>
Date: Mon, 11 Apr 2005 14:40:00 +0400


Hi,

Please read the documentation for this function.

TMath::Poisson(Double_t x, Double_t par)

  // compute the Poisson distribution function for (x,par)
  // The Poisson PDF is implemented by means of Euler's Gamma-function
  // (for the factorial), so for all integer arguments it is correct.
  // BUT for non-integer values it IS NOT equal to the Poisson distribution.
  // see TMath::PoissonI to get a non-smooth function.
  // Note that for large values of par, it is better to call
  //     TMath::Gaus(x,par,sqrt(par),kTRUE)

Datao Gong wrote:

> 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

-- 
			    Best regards,
				    Stanislav.
Received on Mon Apr 11 2005 - 12:43:04 MEST

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