In: Statistics and Probability
(A universal random number generator.)Let X have a continuous, strictly increasing cdf F. Let Y = F(X). Find the density of Y. This is called the probability integral transform. Now let U ∼ Uniform(0,1) and let X = F−1(U). Show that X ∼ F. Now write a program that takes Uniform (0,1) random variables and generates random variables from an Exponential (β) distribution
Probability Integral Transform method:
If
has
distribution, then
such that
or
is an observation from the probability distribution
, this means that we can generate observations from the
distribution
by generating
random variables (which most software programs can do easily) and
applying the
transformation.
Suppose you want to generate instances of an
exponential()
random variable. The cdf is
The following R code generates 10 exponential random variables taking Uniform (0,1) random variables.
n_random = 10
beta = 2
U = runif(n_random, min = 0, max = 1)
Y = −(1/beta)*log(1-U)
Y