> Can you compare the speed of your cython solution with the version of Chuck

For multiple samples of the same distribution, it would do more or less
the same as the "searchsorted" method, so I don't expect any improvement
(except for being easier to find).

For multiple samples of different distributions, my version is 4-5x
faster than "searchsorted(random())". This is without normalizing the
probability vector, which means that you typically don't have to sum up
the whole vector (and store all the intermediate sums).

- Hagen

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to