The inverse transform sampling method is a method of sampling a number at random from any probability distribution, given its cumulative distribution function (cdf).
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.
The inverse transform sampling method works as follows:
- Generate a random number from the standard uniform distribution; call this u.
- Compute 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).