Wallenius' noncentral hypergeometric distribution

Hello, I recently wrote some python code that involved calculating Wallenius' noncentral hypergeometric distribution ( http://en.wikipedia.org/wiki/Wallenius%27_noncentral_hypergeometric_distribu... ). This is similar to the scipy.stats.hypergeom distribution, which is applied to situations like drawing marbles from an urn without replacement, but the noncentral version introduces unequally-weighted probabilities for drawing the different types of marbles. What I have is a multivariate implementation of this (i.e. drawing from 3+ types of marbles). I thought that it might be a good addition to the scipy.stats module. My initial implementation is here: https://github.com/AdamStone/hypergeometric Obviously the above isn't yet in a form consistent with the other scipy.stats distributions, but I wanted to check with the mailing list before committing the time to restructure it. If the list approves, I will go ahead with implementing it in the manner of the other scipy.stats distributions. Thanks, Adam Stone

Hi Adam, On Tue, Dec 23, 2014 at 8:03 PM, Adam Stone <arstone208@gmail.com> wrote:
Hello,
I recently wrote some python code that involved calculating Wallenius' noncentral hypergeometric distribution ( http://en.wikipedia.org/wiki/Wallenius%27_noncentral_hypergeometric_distribu... ).
This is similar to the scipy.stats.hypergeom distribution, which is applied to situations like drawing marbles from an urn without replacement, but the noncentral version introduces unequally-weighted probabilities for drawing the different types of marbles. What I have is a multivariate implementation of this (i.e. drawing from 3+ types of marbles). I thought that it might be a good addition to the scipy.stats module.
My initial implementation is here: https://github.com/AdamStone/hypergeometric
Obviously the above isn't yet in a form consistent with the other scipy.stats distributions, but I wanted to check with the mailing list before committing the time to restructure it. If the list approves, I will go ahead with implementing it in the manner of the other scipy.stats distributions.
This looks to me like a useful distribution to add. I see that there are GPL implementations in R and C++ available - keep in mind that you cannot look at the source code for those, but you can use them to test against to determine the correctness of your implementation. Cheers, Ralf
Thanks, Adam Stone
_______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev
participants (2)
-
Adam Stone
-
Ralf Gommers