Universality of the uniform in the context of the Rayleigh distribution

I am currently exploring a theorem called universality of the uniform:

Let $$F$$ be a CDF which is a continuous function and strictly increasing on the support of the distribution. This ensures that the inverse function $$F^{−1}$$ exists, as a function from $$(0, 1)$$ to $$\mathbb{R}$$. We then have the following results:

• Let $$U \sim \text{Unif}(0,1)$$ and $$X = F^{−1}(U)$$. Then $$X$$ is an r.v. with CDF $$F$$.

• Let $$X$$ be an r.v. with CDF $$F$$. Then $$F(X) \sim \text{Unif}(0,1)$$.

In the context of the Rayleigh distribution, we have the following:

The Rayleigh CDF is

$$F(x) = 1 − e^{-\frac{x^2}{2}}, \ x > 0.$$

The quantile function (the inverse of the CDF) is

$$F^{−1}(u) = 􏰊\sqrt{−2 \log(1 − u)},$$

so if $$U \sim \text{Unif}(0,1)$$, then $$F^{−1}(U) = 􏰊−2\log(1−U) ∼ \text{Rayleigh}$$.

I attempted to derive the inverse $$F^{-1}(U)$$:

\begin{align} & U = 1 - e^{-\frac{x^2}{2}} \\ \Rightarrow & U - 1 = -e^{-\frac{x^2}{2}} \\ \Rightarrow & 1 - U = e^{-\frac{x^2}{2}} \\ \Rightarrow & \log(1 - U) = \dfrac{-x^2}{2} \\ \Rightarrow & -2 \log(1 - U) = x^2 \\ \Rightarrow & x = \pm \sqrt{-2 \log(1 - U)} \\ \therefore \ & F^{-1}(U) = \pm \sqrt{-2 \log(1 - U)} \sim \text{Rayleigh} \end{align}

Ok, so now I'm wondering how one knows in these situations whether it is positive or negative? Is it because

(1) the quantile function associated with the probability distribution of a random variable is the value of the random variable such that the probability of the variable being less than or equal to that value equals the given probability and

(2) the Rayleigh distribution is a continuous probability distribution for nonnegative-valued random variables,

which therefore means that it must be positive?

I would appreciate it if people could please take the time to clarify this.

• Rayleigh distribution is supported on positive numbers (the cdf equals zero for negative numbers) so of course you must take the positive square root, not the negative one. – Shalop Oct 4 at 4:09
• @Shalop I thought so. Thanks for the clarification. – The Pointer Oct 4 at 4:18