Archived

This topic is now archived and is closed to further replies.

uutee

Drawing samples from a CDF

Recommended Posts

Hi, I have a Cumulative Probability Density Function (CDF), F(x) (x>=0 but it doesn't matter here) from which I want to draw samples. My idea is: generate a uniform random number E between [0,1] and solve equation F(x)=E for x. The x obtained is a sample which has the correct distribution (according to the CDF). Is this correct or is my intuition wrong? Oh, and it's not homework =) -Mikko Kauppila [edited by - uutee on January 6, 2004 9:10:07 AM]

Share this post


Link to post
Share on other sites
Yes, you''re right on the mark. That''s the Inverse CDF method. There are a number of other approaches to this problem, but most of the ones I know are much slower.

Just out of curiosity, what are you using this for?

Share this post


Link to post
Share on other sites