encyclopegia.org

Inverse transform sampling

Inverse transform sampling (also known as inversion sampling, the inverse probability integral transform, the inverse transformation method, or the Smirnov transform) 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.[src] Inverse transformation sampling takes uniform samples of a number u between 0 and 1, interpreted as a probability, and then returns the smallest number x\in\mathbb R such that F(x)\ge u for the cumulative distribution function F of a random variable.[src] For example, imagine that F is the standard normal distribution with mean zero and standard deviation one.[src] The table below shows samples taken from the uniform distribution and their representation on the standard normal distribution.[src] 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.[src] Intuitively, we are unlikely to choose a number in the far end of tails because there is very little area in them which would require choosing a number very close to zero or one.…[src]

Inverse transform sampling (also known as inversion sampling, the inverse probability integral transform, the inverse transformation method, or the Smirnov transform) 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.[src] Inverse transformation sampling takes uniform samples of a number u between 0 and 1, interpreted as a probability, and then returns the smallest number x\in\mathbb R such that F(x)\ge u for the cumulative distribution function F of a random variable.[src] For example, imagine that F is the standard normal distribution with mean zero and standard deviation one.[src] The table below shows samples taken from the uniform distribution and their representation on the standard normal distribution.[src] 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.[src] Intuitively, we are unlikely to choose a number in the far end of tails because there is very little area in them which would require choosing a number very close to zero or one.[src] Computationally, this method involves computing the quantile function of the distribution — in other words, computing the cumulative distribution function (CDF) of the distribution (which maps a number in the domain to a probability between 0 and 1) and then inverting that function.[src] This is the source of the term "inverse" or "inversion" in most of the names for this method.[src] Note that for a discrete distribution, computing the CDF is not in general too difficult: we simply add up the individual probabilities for the various points of the distribution.[src] For a continuous distribution, however, we need to integrate the probability density function (PDF) of the distribution, which is impossible to do analytically for most distributions (including the normal distribution).[src] As a result, this method may be computationally inefficient for many distributions and other methods are preferred; however, it is a useful method for building more generally applicable samplers such as those based on rejection sampling.[src] For the normal distribution, the lack of an analytical expression for the corresponding quantile function means that other methods (e.g.[src] the Box–Muller transform) may be preferred computationally.[src] It is often the case that, even for simple distributions, the inverse transform sampling method can be improved on: see, for example, the ziggurat algorithm and rejection sampling.[src] On the other hand, it is possible to approximate the quantile function of the normal distribution extremely accurately using moderate-degree polynomials, and in fact the method of doing this is fast enough that inversion sampling is now the default method for sampling from a normal distribution in the statistical package R.[src] ==Formal statement== For any random variable X on \mathbb R , the random variable F_X^{-1}(U) has the same distribution as X , where F_X^{-1} is the generalized inverse of the cumulative distribution function F_X of X and U is uniform on [0,1] .[src] For continuous random variables, the inverse probability integral transform is indeed the inverse of the probability integral transform, which states that for a continuous random variable X with cumulative distribution function F_X , the random variable U=F_X(X) is uniform on [0,1] .[src] We want to see if we can find some strictly monotone transformation T:[0,1]\mapsto \mathbb{R} , such that T(U)\overset{d}{=}X .[src] We will have F_X(x)=\Pr(X\leq x)=\Pr(T(U)\leq x) = \Pr(U\leq T^{-1}(x))=T^{-1}(x), \text{ for } x\in \mathbb{R}, where the last step used that \Pr(U \leq y) = y when U is uniform on [0,1] .[src] So we got F_X to be the inverse function of T , or, equivalently T(u)=F_X^{-1}(u), u\in [0,1].[src] Therefore, we can generate X from F_X^{-1}(U).[src] ==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 cumulative distribution function F_X .[src] We want to generate values of X which are distributed according to this distribution.[src] The inverse transform sampling method works as follows: Generate a random number u from the standard uniform distribution in the interval [0,1] , i.e.[src] from U \sim \mathrm{Unif}[0,1].[src] Find the generalized inverse of the desired CDF, i.e.[src] F_X^{-1}(u) .[src] Compute X'(u)=F_X^{-1}(u) .[src] The computed random variable X'(U) has distribution F_X and thereby the same law as X .[src] Expressed differently, given a cumulative distribution function F_X and a uniform variable U\in[0,1] , the random variable X = F_X^{-1}(U) has the distribution F_X .[src] In the continuous case, a treatment of such inverse functions as objects satisfying differential equations can be given.[src] Some such differential equations admit explicit power series solutions, despite their non-linearity.[src] F(x)=1-\exp(-\sqrt{x}) \end{align} In order to perform an inversion we want to solve for F(F^{-1}(u))=u \begin{align} F(F^{-1}(u))&=u \\ 1-\exp\left(-\sqrt{F^{-1}(u)}\right) &= u \\ F^{-1}(u) &= (-\log(1-u))^2 \\ &= (\log(1-u))^2 \end{align} From here we would perform steps one, two and three.[src] As another example, we use the exponential distribution with F_X(x)=1-e^{-\lambda x} for x ≥ 0 (and 0 otherwise).[src] By solving y=F(x) we obtain the inverse function x = F^{-1}(y) = -\frac{1}{\lambda}\ln(1-y).[src] It means that if we draw some y_0 from a U \sim \mathrm{Unif}(0,1) and compute x_0 = F_X^{-1}(y_0) = -\frac{1}{\lambda}\ln(1-y_0), This x_0 has exponential distribution.[src] The idea is illustrated in the following graph: Note that the distribution does not change if we start with 1-y instead of y.[src] For computational purposes, it therefore suffices to generate random numbers y in [0, 1] and then simply calculate x = F^{-1}(y) = -\frac{1}{\lambda}\ln(y).[src] ==Proof of correctness== Let F be a cumulative distribution function, and let F^{-1} be its generalized inverse function (using the infimum because CDFs are weakly monotonic and right-continuous): F^{-1}(u) = \inf\;\{x \mid F(x)\geq u\} \qquad (0 Claim: If U is a uniform random variable on [0,1] then F^{-1}(U) has F as its CDF.[src] Proof: \begin{align} & \Pr(F^{-1}(U) \leq x) \\ & {} = \Pr(U \leq F(x)) \quad &(F\text{ is right-continuous, so }\{u:F^{-1}(u)\le x\}=\{u:u\le F(x)\}) \\ & {} = F(x) \quad &(\text{because }\Pr(U \leq u) = u,\text{ when } U \text{ is uniform on }[0,1]) \\ \end{align} ==References==[src]

46 sentences · 46 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Inverse transform sampling." encyclopegia.org, 2025, https://encyclopegia.org/wiki/inverse-transform-sampling. Accessed 26 November 2026.

Chicago

"Inverse transform sampling." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/inverse-transform-sampling.

APA

encyclopegia.org. (2025). Inverse transform sampling. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/inverse-transform-sampling

Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

fast inverse square root

stub · references available

Hankel transform

stub · references available

inverse element

stub · references available

Hit-or-miss transform

stub · references available

fast Fourier transform

stub · references available

Nyquist–Shannon sampling theorem

stub · references available

body fluid sampling

stub · references available

quantum Fourier transform

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1330078866 · 0.5 · snapshot enwiki-001330078866

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.