O'Reilly logo

Simulation for Data Science with R by Matthias Templ

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Simulation of non-uniform distributed random variables

So far, the simulation of the same random variable was discussed. In fact, the generation of uniform random numbers is a very important step. The methods for generating non-uniform random numbers are different. The main aim is to transform random numbers from a uniform distribution to another distribution. Generally, a uniformly distributed random variable, can accordingly be transformed and modified to obtain other distributions.

The inversion method

The condition is that uniformly distributed random numbers are already generated in the interval [0,1]. The inversion method takes advantage of the fact that a distribution function is also defined in the interval [0,1].

Let be the distribution ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required