Inverse-transform method

Definition taught in Simulation, part of Probability

Inverse-transform method

The inverse-transform method. From Simulation.
Type Definition
Taught in Simulation
Part Probability
Worked examples 2
Questions using it 1

Let F be a distribution function and define F^{-1}(u)=\inf\{x:F(x)\ge u\} for u\in(0,1). If U\sim\operatorname{U}[0,1], then X=F^{-1}(U) has distribution function F.

Examples

Draws from an exponential law

Explain how to generate a draw from the exponential distribution with rate 10, starting from a uniform draw on [0,1].

Draw U\sim\operatorname{U}[0,1] and return X=-\log(U)/10. This is the inverse-transform method: the distribution function 1-e^{-10x} inverts to -\log(1-u)/10, and 1-U has the same distribution as U.

A shifted exponential density

A density is f(x)=4e^{-4(x-1)} for x\ge 1, and f(x)=0 otherwise.

  1. Find the expectation of a random variable with this density.

  2. Explain how to generate such a random variable from a single uniform draw on [0,1].

  1. If X has this density, then Y=X-1 has density 4e^{-4y} for y\ge0, which is \operatorname{Exp}(4). So \mathbb{E} X=1+1/4=1.25.

  2. The distribution function is F(x)=1-e^{-4(x-1)} for x\ge1. Solving F(x)=u gives x=1-\tfrac14\log(1-u). Draw U\sim\operatorname{U}[0,1] and return 1-\tfrac14\log U, using that 1-U is again uniform.

Used in

See also

Cumulative distribution function · Linear congruential generator · Acceptance–rejection method

Glossary and index