2

my question is quite generic. I am currently studying the algorithms calculating random numbers from distributions:

In inverse transform method we get the cumulative distribution function in the end and take the random variable from there. Whereas in rejection method, we are working directly with pdf. I got a little bit confused if we normally sample from cdf , since I have never come across it before.

I know what the cdf and pdf are and that they are tightly linked.

Hopefully, someone can clarify it to me if sampling from cdf is a common approach.

Karina
  • 31
  • 2
  • 2
    There are a very large number of ways to sample from a distribution. Many do not need mathematical representations of the PDF or the CDF. It's difficult to use the CDF directly, but its inverse -- the quantile function -- gives perhaps the simplest, most direct method of sampling *provided* the quantile function can be computed. For more about this particular method see https://stats.stackexchange.com/search?q=inverse+transform+sampling. – whuber Nov 12 '20 at 17:12
  • 2
    Theoretically one can simulate from any function identifying the distribution, e.g., pdf, cdf, mgf, quantile function, characteristic function... – Xi'an Nov 12 '20 at 17:26

1 Answers1

1

There are algorithms that sample random variates using both the PDF and CDF of a distribution. One example is the inversion-rejection method described in chapter 7 of Non-Uniform Random Variate Generation (Devroye 1986), which works for any unimodal distribution for which the mode is known.

Peter O.
  • 863
  • 1
  • 4
  • 18