Ratio Of Uniforms
   HOME

TheInfoList



OR:

The ratio of uniforms is a method initially proposed by Kinderman and Monahan in 1977 for
pseudo-random number sampling Non-uniform random variate generation or pseudo-random number sampling is the numerical practice of generating pseudo-random numbers (PRN) that follow a given probability distribution. Methods are typically based on the availability of a unifo ...
, that is, for drawing random samples from a
statistical distribution In statistics, an empirical distribution function ( an empirical cumulative distribution function, eCDF) is the distribution function associated with the empirical measure of a sample. This cumulative distribution function is a step functio ...
. Like
rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
and
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 sampl ...
, it is an exact simulation method. The basic idea of the method is to use a change of variables to create a bounded set, which can then be sampled uniformly to generate random variables following the original distribution. One feature of this method is that the distribution to sample is only required to be known up to an unknown multiplicative factor, a common situation in computational statistics and statistical physics.


Motivation

A convenient technique to sample a statistical distribution is
rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
. When the
probability density function In probability theory, a probability density function (PDF), density function, or density of an absolutely continuous random variable, is a Function (mathematics), function whose value at any given sample (or point) in the sample space (the s ...
of the distribution is bounded and has finite
support Support may refer to: Arts, entertainment, and media * Supporting character * Support (art), a solid surface upon which a painting is executed Business and finance * Support (technical analysis) * Child support * Customer support * Income Su ...
, one can define a bounding box around it (a uniform proposal distribution), draw uniform samples in the box and return only the x coordinates of the points that fall below the function (see graph). As a direct consequence of the fundamental theorem of simulation, the returned samples are distributed according to the original distribution. When the support of the distribution is infinite, it is impossible to draw a rectangular bounding box containing the graph of the function. One can still use
rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
, but with a non-uniform proposal distribution. It can be delicate to choose an appropriate proposal distribution, and one also has to know how to efficiently sample this proposal distribution. The method of the ratio of uniforms offers a solution to this problem, by essentially using as proposal distribution the distribution created by the ratio of two uniform random variables.


Statement

The statement and the proof are adapted from the presentation by Gobet


Complements


Rejection sampling in A_

The above statement does not specify how one should perform the uniform sampling in A_. However, the interest of this method is that under mild conditions on f (namely that f(x_1, x_2, \ldots, x_d)^ and x_i f(x_1, x_2, \ldots, x_d)^\frac for all i are bounded), A_ is bounded. One can define the rectangular bounding box \tilde_ such thatA_ \subset \tilde_ = \left , \sup_\right\times \prod_i \left inf_, \sup_\right/math>This allows to sample uniformly the set A_ by
rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
inside \tilde_. The parameter r can be adjusted to change the shape of A_ and maximize the acceptance ratio of this sampling.


Parametric description of the boundary of A_

The definition of A_ is already convenient for the rejection sampling step. For illustration purposes, it can be interesting to draw the set, in which case it can be useful to know the parametric description of its boundary:u = f\left(x_1, x_2, \ldots, x_d \right)^\frac \quad\text\quad \forall i \in In the 1-dimensional case, if g: \mathbb^+\rightarrow\mathbb^+ is a strictly increasing and differentiable function such that g(0) = 0, then we can define A_ such that : A_ = \left\ If (U, V) is a random variable uniformly distributed in A_, then \frac is distributed with the density p.


Examples


The exponential distribution

Assume that we want to sample the
exponential distribution In probability theory and statistics, the exponential distribution or negative exponential distribution is the probability distribution of the distance between events in a Poisson point process, i.e., a process in which events occur continuousl ...
, p(x) = \lambda \mathrm^ with the ratio of uniforms method. We will take here r = 1. We can start constructing the set A_: : A_ = \left\ The condition 0\leq u\leq \sqrt is equivalent, after computation, to 0\leq v\leq -\frac\ln\frac, which allows us to plot the shape of the set (see graph). This inequality also allows us to determine the rectangular bounding box \tilde_ where A_ is included. Indeed, with g(u) = -\frac\ln\frac, we have g\left(\sqrt\right) = 0 and g'\left(\frac\right) = 0, from where \tilde_ = \left , \sqrt\righttimes\left , \frac\right/math>. From here, we can draw pairs of uniform random variables U \sim \mathrm\left(0, \sqrt\right) and V \sim \mathrm\left(0, \frac\right) until u \leq \sqrt, and when that happens, we return \frac, which is exponentially distributed.


A mixture of normal distributions

Consider the
mixture In chemistry, a mixture is a material made up of two or more different chemical substances which can be separated by physical method. It is an impure substance made up of 2 or more elements or compounds mechanically mixed together in any proporti ...
of two
normal distribution In probability theory and statistics, a normal distribution or Gaussian distribution is a type of continuous probability distribution for a real-valued random variable. The general form of its probability density function is f(x) = \frac ...
s \mathcal = 0.6\,N(\mu=-1, \sigma=2)+0.4\,N(\mu=3, \sigma=1). To apply the method of the ratio of uniforms, with a given r, one should first determine the boundaries of the rectangular bounding box \tilde_ enclosing the set A_. This can be done numerically, by computing the minimum and maximum of u(x) = f(x)^\frac and v(x) = x\,f(x)^\frac on a grid of values of x. Then, one can draw uniform samples (u, v)\in \tilde_, only keep those that fall inside the set A_ and return them as \frac. It is possible to optimize the acceptance ratio by adjusting the value of r, as seen on the graphs.


Software

* The rust and Runuran contributed packages in R.


See also

*
Rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
*
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 sampl ...


References

{{reflist Pseudorandom number generators Non-uniform random numbers>1, n, v_i = x_i u^ror for the common case where X is a 1-dimensional variable, (u, v) = \left(f(x)^\frac, x\,f(x)^\frac\right).


Generalized ratio of uniforms

Above parameterized only with r, the ratio of uniforms can be described with a more general class of transformations in terms of a transformation ''g''. In the 1-dimensional case, if g: \mathbb^+\rightarrow\mathbb^+ is a strictly increasing and differentiable function such that g(0) = 0, then we can define A_ such that : A_ = \left\ If (U, V) is a random variable uniformly distributed in A_, then \frac is distributed with the density p.


Examples


The exponential distribution

Assume that we want to sample the
exponential distribution In probability theory and statistics, the exponential distribution or negative exponential distribution is the probability distribution of the distance between events in a Poisson point process, i.e., a process in which events occur continuousl ...
, p(x) = \lambda \mathrm^ with the ratio of uniforms method. We will take here r = 1. We can start constructing the set A_: : A_ = \left\ The condition 0\leq u\leq \sqrt is equivalent, after computation, to 0\leq v\leq -\frac\ln\frac, which allows us to plot the shape of the set (see graph). This inequality also allows us to determine the rectangular bounding box \tilde_ where A_ is included. Indeed, with g(u) = -\frac\ln\frac, we have g\left(\sqrt\right) = 0 and g'\left(\frac\right) = 0, from where \tilde_ = \left , \sqrt\righttimes\left , \frac\right/math>. From here, we can draw pairs of uniform random variables U \sim \mathrm\left(0, \sqrt\right) and V \sim \mathrm\left(0, \frac\right) until u \leq \sqrt, and when that happens, we return \frac, which is exponentially distributed.


A mixture of normal distributions

Consider the
mixture In chemistry, a mixture is a material made up of two or more different chemical substances which can be separated by physical method. It is an impure substance made up of 2 or more elements or compounds mechanically mixed together in any proporti ...
of two
normal distribution In probability theory and statistics, a normal distribution or Gaussian distribution is a type of continuous probability distribution for a real-valued random variable. The general form of its probability density function is f(x) = \frac ...
s \mathcal = 0.6\,N(\mu=-1, \sigma=2)+0.4\,N(\mu=3, \sigma=1). To apply the method of the ratio of uniforms, with a given r, one should first determine the boundaries of the rectangular bounding box \tilde_ enclosing the set A_. This can be done numerically, by computing the minimum and maximum of u(x) = f(x)^\frac and v(x) = x\,f(x)^\frac on a grid of values of x. Then, one can draw uniform samples (u, v)\in \tilde_, only keep those that fall inside the set A_ and return them as \frac. It is possible to optimize the acceptance ratio by adjusting the value of r, as seen on the graphs.


Software

* The rust and Runuran contributed packages in R.


See also

*
Rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
*
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 sampl ...


References

{{reflist Pseudorandom number generators Non-uniform random numbers