Inverse transform sampling (also known as inversion sampling, the inverse probability integral transform, the inverse transformation method, Smirnov transform, golden rule, etc.) is a basic method for pseudo-random number sampling, i.e. for generating sample numbers at random from any probability distribution given its cumulative distribution function (CDF).


The basic idea is to uniformly sample a number u between 0 and 1, interpreted as a probability, and then return the largest number x from the domain of the distribution p(X) such that p(-∞ < X < x).


For example, imagine that p(X) is the standard normal distribution (with mean 0, standard deviation 1). Then if we choose u = 0.5, we would return 0, because 50% of the probability of a normal distribution occurs in the region where X ≤ 0.

Similarly, if we choose u = 0.975, we would return 1.95996...; if we choose u = 0.995, we would return 2.5758...; if we choose u = 0.999999, we would return 4.891638...; etc.

(input과 output이 일반적인 경우의 역)

Essentially, we are randomly choosing a proportion of the area under the curve and returning the number in the domain such that exactly this proportion of the area occurs to the left of that number. Intuitively, we are unlikely to choose a number in the tails because there is very little area in them: We'd have to pick a number very close to 0 or 1.


Definition

The probability integral transform states that if X is a continuous random variable with cumulative distribution function FX, then the random variable Y = FX(X) has a uniform distribution on [0, 1].

The inverse probability integral transform is just the inverse of this: specifically, if Y has a uniform distribution on [0, 1] and if X has a cumulative distribution FX, then the cumulative distribution function of the random variable FX-1(Y) is FX.


Method

The problem:

  • Let X be a random variable whose distribution can be described by the cumulative distribution function F.
  • We want to generate values of X which are distributed according to this distribution.

Inverse transform sampling method works as follows:

  1. Generate a random number u from the standard uniform distribution in the interval [0, 1].
  2. Compute the value x such that F(x) = u. (x = F-1(u)로 구함)
  3. Take x 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 cumulative distribution function F, the random variable X = F−1(U) has distribution F (or, X is distributed F).


Summary

특정 확률분포에서 함수곡선의 아래 면적은 1이다. 그래서 0에서 1사이의 범위로 랜덤하게 u를 고르고 기존 확률분포의 CDF의 역함수에 u를 집어넣어서 x를 구해낸다.



References