- Inverse transform sampling
Inverse transform sampling, also known as the probability integral transform, is a method of generating sample numbers at random from any
probability distribution given itscumulative distribution function (cdf). This method is generally applicable, but may be too computationally expensive in practice for some probability distributions. SeeBox-Muller transform for an example of an algorithm which is less general but more computationally efficient.Definition
The "probability integral transform" states that if "X" is a
continuous random variable with a strictly increasingcumulative distribution function "F""X", and if "Y" = "F""X"("X"), then "Y" has auniform distribution on [0, 1] .The method
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 "F".
*We want to generate values of "X" which are distributed according to this distribution.Many
programming language s have the ability to generate pseudo-random numbers which are effectively distributed according to the standarduniform distribution . If a random variable has that distribution, then the probability of its falling within any subinterval ("a", "b") of the interval from 0 to 1 is just the length "b" − "a" of that subinterval.The inverse transform sampling method works as follows:
#Generate a random number from the standard uniform distribution; call this "u".
#Compute the value "x" such that ; call this "x"chosen.
#Take "x"chosen to be the random number drawn from the distribution described by "F".Expressed differently, given a continuous uniform variable "U" in [0, 1] and an invertible distribution function "F", the random variable "X" = "F" −1("U") has distribution "F" (or, "X" is distributed "F").
A treatment of such inverse functions as objects satisfying differential equations can be given. [Steinbrecher, G., Shaw, W.T. (2008). Quantile mechanics. "European Journal of Applied Mathematics" 19 (2): 87-112.] Some such differential equations admit explicit power series solutions, despite their non-linearity.
Proof of correctness
Let "F" be a continuous
cumulative distribution function , and let be its inverse function: [Luc Devroye. "Non-Uniform Random Variate Generation". New York: Springer-Verlag, 1986. ( [http://cg.scs.carleton.ca/~luc/rnbookindex.html online] ) "See [http://cg.scs.carleton.ca/~luc/chapter_two.pdf chapter 2] , section 2, p. 28."]:
Wikimedia Foundation. 2010.