probability distribution function in python

Tomasz Lisowski lisowski.tomasz at sssa.NOSPAM.com.pl
Tue Apr 10 08:37:35 EDT 2001


It is numerically a bad idea to compute the factorial directly. Most often
it is encountered in expressions, where two similarly huge numbers are
divided, resulting in a quite normal (not so huge) number.

x^n/n! should be computed as exp(n*Ln(x) - Ln(n!)), where Ln is a natural
logarithm, and Ln(n!) can be computed using Stirling expansion for a
factorial (see Abramowitz, Stegun, Handbook of mathematical functions - if I
remember correctly the reference)

Best regards,

Tomasz Lisowski

U¿ytkownik "Tawee Laoitichote" <astpspd at pea.or.th> napisa³ w wiadomoœci
news:mailman.986885471.6070.python-list at python.org...
Hello,

I'm doing something concerning probability distribution function. Does
anyone can resolve the factorial function  ==> n! (the denominator of
Poisson DF)since it will overflow the integer limit.

Or, where can I find it in any python modules or library? Thanks.

tawee





More information about the Python-list mailing list