Alex wrote:
Thanks for the many answers.

So basically I have to get the inverse of the CDF and use this to
transform my uniformly distributed random numbers. If my desired
distribution is simple I can get an analytical solution for the
inverse, otherwise I have to use numerical methods.

Okay, things are now much clearer.

It's worth noting that unless if the PPF (the inverse of the CDF) is very straightforward, this method is not very good. The numerical errors involved cause very poor results in the tails of many distributions. Typically, rejection sampling, if done well, will work much better. There are techniques for doing this on nearly-arbitrary distributions:

  http://statmath.wu-wien.ac.at/projects/arvag/index.html

If you implement any of these techniques in Python, I would love to see them.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to