# “Convert” Rayleigh random variable into a Uniform random variable?

I have a nested question of sorts. My first question, is that I am wondering if it is possible to 'convert' a Rayleigh random variable into a uniform random variable, and how one may do this.

Strongly related and dependent on this question though, is: if such a conversion was possible, would 'corrupt data', being defined here as outliers in the original Rayleigh PDF, also remain 'corrupt' outliers in the uniform distribution?

• a) yes, just use the cdf of the chi2 with 2 degrees of freedom. b) No. They will no longer be outliers. – user603 Jul 1 '13 at 19:34
• @user603 Thank you. Is it a general principle, that outliers in one PDF, will never be outliers in the PDF to which they got converted to, or is this just something specific? – Creatron Jul 1 '13 at 19:36
• yes. An outlier has to be a able to drive an estimator to a specific (but arbitrary) value, regardless of the distribution of the majority of the data. A value drawn from a bounded distribution can't do that. – user603 Jul 1 '13 at 19:39
• No, that is not a general principle: @user603 is just assuming the outliers are not "extreme." They might or might not be outliers after the transformation. What can be said, though, is that if (say) $n$ values were drawn independently and randomly according to a $\chi^2$ distribution and an $n+1$st much larger value were thrown in, then--upon applying this probability transformation--as $n$ gets "large" it is highly likely (but not completely certain) that the $n+1$ resulting values would exhibit no apparent outliers. ("Large" means bigger than $2$ or so in this case. :-) – whuber Jul 1 '13 at 19:44
• With $N$ that large, for all practical purposes @user603 is absolutely right: you won't see any outliers among the transformed variables. (The chance of that happening is somewhere around $10^{-200}$ or so, depending on what outlier-detection algorithm you use.) – whuber Jul 1 '13 at 20:12

## 1 Answer

Your assertion that "a $\chi^{2}$ random variable (with 2 degrees of freedom; aka Rayleigh random variable)" is incorrect: a $\chi^{2}$ random variable with two degrees of freedom is an exponential random variable with mean $2$, and not a Rayleigh random variable.

Following up user603's comments and my own comments about distributions,

• If $X$ is a $\chi^2$ random variable with two degrees of freedom, then its CDF is $F_X(x) = [1 - \exp(-x/2)]\mathbf 1_{x\in [0,\infty)}$ and so if $x_1, x_2, \ldots, x_n$ are samples of $X$, then $y_1, y_2, \ldots, y_n$ are samples of a $U[0,1)$ random variable where $y_i = 1-e^{-x_i/2}$, $1 \leq i \leq n$.

• If $Z$ is a Rayleigh random variable, its CDF is $F_Z(z) = [1 - \exp(-z^2/2)]\mathbf 1_{z\in [0,\infty)}$ and so if $z_1, z_2, \ldots, z_n$ are samples of $Z$, then $w_1, w_2, \ldots, w_n$ are samples of a $U[0,1)$ random variable where $w_i = 1-e^{-z_i^2/2}$, $1 \leq i \leq n$.

• $\sqrt{X}$ is a Rayleigh random variable, and so if we have samples $x_1, x_2, \ldots, x_n$ of $X$, then $\sqrt{x_1}, \sqrt{x_2}, \ldots, \sqrt{x_n}$ are samples of a Rayleigh random variable, and regardless of whether we choose to map $x_i \mapsto 1-e^{-x_i/2}$ or to map $\sqrt{x_i} \mapsto 1-e^{-\left(\sqrt{x_i}\right)^2/2}$, we get the same $y_1, y_2, \ldots, y_n$ as samples of a $U[0,1)$ random variable.

With regard to your question about outliers, note that the mean of $X$ is $2$ which maps to $1-e^{-1} \approx 0.632$ and so outliers, say any sample larger than $10$, are mapped into a narrow range $[0.99326\ldots, 1)$. Remember that sample values close to $0$ are not outliers, since the density of $X$ is a monotone decreasing function on $\mathbb R^+$ and so values close to $0$ are highly likely and not rare at all.

• Thanks for your answer Dilip, it clears up a lot. This use of an rv's CDF to go to Uniform rv, is this a 'standard' method that can be applied to any PDF out there? Regarding the last part, yes, for me, the outliers (in the original Rayleigh PDF) are very large values relative to the rest. – Creatron Jul 2 '13 at 14:49
• PS I cannot upvote you because I dont have enough reputation apparently... – Creatron Jul 2 '13 at 14:50
• Yes. For any continuous random variable $X$, $F(X)$ is uniformly distributed on the unit interval. – Dilip Sarwate Jul 2 '13 at 19:29