what's the distribution of CDF(X) when X belong to normal distribution

115 Views Asked by At

Say I sample X from a standard normal distribution. Then send those X to a standard normal CDF and get Y, then I plot the histogram of Y

it looks like they belong to a uniform distribution, but how do I express this in formula?

code:

import numpy as np
import scipy
import matplotlib.pyplot as plt
import seaborn as sns


x = np.random.normal(0,1,100000)
norm_cdf = scipy.stats.norm.cdf(x)

# plot the cdf
plt.subplot(211)
sns.distplot(x)
plt.subplot(212)
sns.distplot(norm_cdf)
plt.show()

enter image description here

2

There are 2 best solutions below

0
On BEST ANSWER

You are defining $Y=F(X)$. As $F$ takes values in $[0,1]$, so does $Y$.

Consider $$ \begin{align} P(Y \le y ) &= P(F(X) \le y) \\ &= P(X \le F^{-1}(y))\\ &= F(F^{-1}(y)) \\ &= y \end{align} $$ which is the CDF of the uniform distribution. In summary you have $Y\sim U(0,1)$ as you speculated. It's called the Probability Integral Transform.

0
On

Pick $p\in [0, 1]$. What is the probability that $CDF(X)\leq p$? It is the same as that of $X\leq CDF^{-1}(p)$, which is $p$ by definition of the CDF. Thus $CDF(X)$ follows the uniform distribution on $[0, 1]$. This holds for any RV with a continuous pdf.