[Math] Let $X$ be a continuous random variable with cdf, $F_X(x)$ and let $Y=F_X^{-1}(U)$ where $U$ is a continuous uniform from zero to one. Find cdf of $Y$

statistics

Let $X$ be a continuous random variable with cdf, $F_X(x)$ and let $Y=F_X^{-1}(U)$.The distribution function is strictly increasing on a single interval (which could be infinite, so that the inverse function $F_X^{-1}(y)$ is defined in the natural way.$U$ is a continuous uniform random variable on the interval zero to one. Find cdf of $Y$

So I believe I have the density function of $U$ is $f(x)=1$ for $0\leq x\leq 1$ and $f(x)=0$ otherwise.

But I'm not sure how to interpret $F_X^{-1}(U)$,

I realize its the inverse of $F_X$ but I don't understand what $U$ is.

Best Answer

Suppose that $X \sim \mathsf{Exp}(\lambda = 1)$ so that $F_X(u) = 1 - e^{-u}.$ Then, after a little algebra one has $F_X^{-1}(u) = -\ln(1-u).$

If you let $U \sim \mathsf{Unif}(0,1),$ then $F_X^{-1}(U) \sim \mathsf{Exp}(1).$

This is a method for simulating a random variable $X$ by inverting its CDF (if feasible), and then transforming a standard uniform random variable $U$ according to the inverse CDF of of $X,$ sometimes known as the quantile function of $X.$ [The output of a satisfactory pseudorandom number generator is essentially indistinguishable from independent realizations of a standard uniform random variable.]

Demonstration in R:

set.seed(411)    # for reproducibility
u = runif(10^5)  # generate values from UNIF(0,1)
x = -log(1 - u)  # quantile transform to get EXP(1)
hist(x, prob=T, ylim=c(0,1), br = 30, col="skyblue2")
 curve(dexp(x), add=T, col="red", lwd=2, n = 10001)

enter image description here

The first 5000 realizations of $X$ above pass a Kolmogorv-Smirnov test for $\mathsf{Exp}(1).$ [The test can't accommodate more than 5000 values.]

ks.test(x[1:5000], "pexp", 1)

        One-sample Kolmogorov-Smirnov test

data:  x[1:5000]
D = 0.012407, p-value = 0.4248
alternative hypothesis: two-sided
Related Question