Hypergeometric distribution

2005-12-26 Thread Raven
Hi to all, I need to calculate the hpergeometric distribution: choose(r, x) * choose(b, n-x) p(x; r,b,n) = - choose(r+b, n) choose(r,x) is the binomial coefficient I use the factorial to calculate the above fo

Re: Hypergeometric distribution

2005-12-31 Thread Raven
Thanks to all of you guys, I could resolve my problem using the logarithms as proposed by Robert. I needed to calculate the factorial for genomic data, more specifically for the number of genes in the human genome i.e. about 30.000 and that is a big number :-) I didn't know gmpy Thanks a lot, real

Re: Hypergeometric distribution

2006-01-01 Thread Raven
Thanks Steven for your very interesting post. This was a critical instance from my problem: >>>from scipy import comb >>> comb(14354,174) inf The scipy.stats.distributions.hypergeom function uses the scipy.comb function, so it returned nan since it tries to divide an infinite. I did not tried to

Re: Hypergeometric distribution

2006-01-02 Thread Raven
Well, what to say? I am very happy for all the solutions you guys have posted :-) For Paul: I would prefer not to use Stirling's approximation The problem with long integers is that to calculate the hypergeometric I need to do float division and multiplication because integer division returns 0.

Re: Hypergeometric distribution

2006-01-02 Thread Raven
Scott David Daniels ha scritto: > You should really look into the timeit module -- you'll get nice > solid timings slightly easier to tweak. This seems a very interesting module, I will give it a try as soon as possible. Thanks Scott. Ale -- http://mail.python.org/mailman/listinfo/python-list

Re: Hypergeometric distribution

2006-01-02 Thread Raven
Bengt Richter wrote: > ISTM you wouldn't get zero if you scaled by 10**significant_digits (however > many > you require) before dividing. E.g., expected hits per trillion (or septillion > or whatever) > expresses probability too. Perhaps that could work in your calculation? > > Regards, > Bengt

Re: Hypergeometric distribution

2006-01-02 Thread Raven
Bengt Richter wrote: > ISTM you wouldn't get zero if you scaled by 10**significant_digits (however > many > you require) before dividing. E.g., expected hits per trillion (or septillion > or whatever) > expresses probability too. Perhaps that could work in your calculation? > > Regards, > Beng

Re: Hypergeometric distribution

2006-01-03 Thread Raven
Travis E. Oliphant wrote: > Notice the keyword for the comb function (in scipy) lets you use it to > compute exact values. SciPy does not just automatically use the long > integer because this will always slow you down. > > comb(N, k, exact=0) > > Combinations of N things taken k at a time. > >

Re: Hypergeometric distribution

2006-01-04 Thread Raven
. and hence the hypergeometric returns nan. The first suggestion, the one by Robert Kern, resolved my problem: Raven wrote: >Thanks to all of you guys, I could resolve my problem using the >logarithms as proposed by Robert. Then the other guys gave alternative solutions so I tried them out.

cxFreeze executable linked to /usr/lib/libpython2.3.so

2006-06-06 Thread Raven
Hi, I compiled a python script using cxFreeze because I need a standalone application, while the Windows version runs without any python installation the linux version of the executable is linked to libpython2.3.so.1.0 => /usr/lib/libpython2.3.so.1.0 thus the end user have to install python 2.3

Re: wxTreeCtrl Q?

2006-02-01 Thread Raven
I hope this can help: http://wxwidgets.org/manuals/2.6.1/wx_wxtreectrl.html#wxtreectrlsetitemfont http://wxwidgets.org/manuals/2.6.1/wx_wxtreectrl.html#wxtreectrlsetitembold This pages are from the wxwidgets api reference but the functions are the same in wxPython Bye Ale -- http://mail.pytho

Re: Easy-to-use Python GUI

2008-12-24 Thread Raven
On 25 дек, 06:47, "Joel Koltner" wrote: > Is there an easy-to-use, "function"-based cross-platform GUI toolkit for > Python out there that's a little more sophisticated than EasyGui?  EasyGui > looks good, but it's a little more restrictive than what I'd like to have, yet > I'm (stubbornly :-) ) r