Jump to content
  • Advertisement

Archived

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

uutee

Drawing samples from a CDF

This topic is 5304 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!