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

From: Anna Kreshuk <anna.krechtchouk_at_cern.ch>
Date: Mon, 11 Apr 2005 14:18:48 +0200


Hi,

As the comments to the TMath::Poisson function say, it is not equal to Poisson distribution for non-integer values of x. So, use TMath::PoissonI function instead, or, when computing the integral, start with an integer and take integer steps, and you will get what you expect. Example:

void test2()
{
  Double_t sum = 0;
  Int_t n = 10;
  Double_t x;
  for (Int_t i=0; i<n; i++) {
    x = i;
    sum+=TMath::Poisson(x, 1);
  }
  printf("sum = %f\n", sum);
} Received on Mon Apr 11 2005 - 14:18:53 MEST

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