it has too high memory cost though, compared to float + binary search
it scales larger than O(n)
Login to reply
Replies (1)
its <= twice the size, not sure that really matters.
I was also looking at which seems memory optimal but was more complex
Fast Generation of Discrete Random Variables
| Journal of Statistical Software