Oh, that looks nice. This is really great. I worked on a project a while back in which I needed to generate a discrete probability distribution, and found Python's support for this to be lacking. I ended up having to hard-code most of the distribution and then use multipliers to cover other cases, which I found very mathematically unsatisfying.
Thus, I think Lea looks very helpful for certain use-cases related to discrete probability. Great!
The great thing about python is that we all get to implement such a library ourselves, using our own idioms and lack of documentation and/or unit tests.
I doubt that there are no existing libraries in Python that allow to work with discrete probability distributions.
Not that it stops anyone from implementing their own.
7 comments
[ 4.8 ms ] story [ 34.6 ms ] threadThus, I think Lea looks very helpful for certain use-cases related to discrete probability. Great!
[1] http://en.wikipedia.org/wiki/Alias_method or http://www.keithschwarz.com/darts-dice-coins/
EDIT: User rawnlq beat me to mentioning the alias method. I second the recommendation.