**Next message:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Previous message:**Fons Rademakers: "Re: [ROOT] Problems with shared libraries in rootd authentication"**In reply to:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Next in thread:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Reply:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ]

Even a check to see that the function is returning a finite value would be nice. If I remember my probability distributions correctly, a Poisson probability has to be between zero and one, so it shouldn't return a non-finite value. I believe that zero would be the right value to return if the calculation gives a non-sensical number. Failing that, I'd even take something where you test the input values, and if they are bigger than the Gamma or Power functions could handle correctly, you give a printout that said "Why are you trying to calculate a Poisson probability with such large numbers, you fool!" Best wishes. Ken On Mon, 26 Apr 2004, Rene Brun wrote: > Ken, > > I will be happy to add any suggestion you might have to protect the code > against the case you mention. > > Rene Brun > > On > Mon, 26 Apr 2004, Ken Bloom wrote: > > > Dear ROOTers, > > > > I'm using ROOT 3.05/07, and am getting non-numerical results out of > > the TMath::Poisson function, under what I admit are extreme conditions: > > > > root [2] TMath::Poisson(170,70) > > Error: Symbol inf is not defined in current scope FILE: LINE:0 > > (Double_t)inf > > *** Interpreter error recovered *** > > > > Yes, I know that the result should be a very tiny number, but I would prefer > > that I get 0.0 (or its moral equivalent) rather than something I can't do math > > with. Can you recommend a protection against this? Thanks, best wishes. > > > > Ken Bloom > > > > ------------------------------------------------------------------------------ > > Ken Bloom, Karma Adjuster Department of Physics > > 734-763-2329 / 734-936-1817 (fax) University of Michigan > > kenbloom@umich.edu http://www.umich.edu/~kenbloom > > > ------------------------------------------------------------------------------ Ken Bloom, Karma Adjuster Department of Physics 734-763-2329 / 734-936-1817 (fax) University of Michigan kenbloom@umich.edu http://www.umich.edu/~kenbloom

**Next message:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Previous message:**Fons Rademakers: "Re: [ROOT] Problems with shared libraries in rootd authentication"**In reply to:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Next in thread:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Reply:**Rene Brun: "Re: [ROOT] inf/nan from TMath::Poisson"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ]

*
This archive was generated by hypermail 2b29
: Sun Jan 02 2005 - 05:50:07 MET
*