Inverse transform sampling
Appearance
The problem that the Inverse transform sampling method solves is as follows:
- Let X be a random variable whose distribution can be described by the cdf d(x).
- We want to generate values of x which are distributed according to this distribution.
Many programming languages have the ability to generate pseudo-random numbers which are effectively distributed according to the [[standard uniform distribution]]. These are values within the range 0 to 1, where each value is equally-likely.
The Inverse transform sampling method works as follows:
- Generate a random number from the standard uniform distribution; call this u.
- Look-up the value for x which has the associated cdf value u; call this xchosen.
- Take xchosen to be the random number drawn from the distribution described by d(x).
The following diagram may help the reader to visualise how the method works: