1
$\begingroup$

I was taking a look at this page, and I can't seem to understand why the frequency plot of the percentiles is uniformly distributed. Distances between percentiles are not equal, so why is the histogram relatively uniform?

enter image description here

Percentiles:

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ rb612: Let $Y=F_X(X)$ for some continuous invertible $F$. $P(Y\leq y) = P(F_X(X)\leq y) = P(X\leq F_X^{-1}(y)) = F_X(F_X^{-1}(y)) = y$. Hence $F_X(X)$ is uniform $\endgroup$
    – Glen_b
    Aug 8 '15 at 10:04
  • $\begingroup$ @Stephane I saw it after I replied. Hang on I'll delete the comment; but leave your reply to me here so you don't have everyone doing what I did. $\endgroup$
    – Glen_b
    Aug 8 '15 at 10:07
  • $\begingroup$ I deleted what needed deletion. If you want to delete the first comment, you can; I would then delete everything under it except my comment to rb612 $\endgroup$
    – Glen_b
    Aug 8 '15 at 12:20
2
$\begingroup$

Take uniformly distributed vector $U$ and cumulative distribution function $F$ of some distribution, then you can transform $F^{-1}(U) = X$ to get continuous random variable $X$ having $F$ CDF.

This is often used in generating random variables using inverse transform sampling, that enables us to generate random variable with any distribution starting with a vector of random variable $U$.

You can see an example below, where $U$ is passed through CDF functions of Normal distribution, $t$-distribution, Uniform distribution, and Beta.

U <- seq(0, 1, by = 0.01)
plot(qnorm(U), U, type = "l", xlab="")
lines(qt(U, 3), U, col = "red")
lines(qunif(U), U, col = "blue")
lines(qbeta(U, 3, 7), U, col = "green")

enter image description here

As you can see, $U$ is always the same and uniformly distributed, while the CDF's differ a lot.

This relation is used, for example, in equipercentile equating in educational research, where having scores on test $X$ you can transform them to scale of test $Y$ so that both tests share common scale. Since $F^{-1}(U) = X$ is valid for continuous random variables, in methods as equipercentile equating discrete scores are continized so for this property to hold.

This leads to $F(X) = U$, i.e. percentiles are uniformly distributed. Below you can see an example where Normally distributed random variable $X$ is transformed using inverse CDF and the resulting variable $U$ is uniformly distributed.

X <- rnorm(1e5)
hist(pnorm(X))

enter image description here

If you want an intuitive example, let's consider a very simple case of Bernoulli distribution with two possible states $\{0, 1\}$, that have probabilities $1-p$ and $p$. If you want to sample from this distribution, you can take a line $U$ that starts at $0$ and ends at $1$ and choose some points at this line at random. Then for points lower or equal to $1-p$ set $X$'s to $0$'s and for values greater than $1-p$ set $X$'s to $1$'s. The sample obtained this way will be Bernoulli distributed with parameter $p$.

$\endgroup$
3
  • $\begingroup$ @StéphaneLaurent right, but it is often still applicable also in other cases. I edited to be more precise. $\endgroup$
    – Tim
    Aug 8 '15 at 8:26
  • $\begingroup$ Tim, I think there's still a confusion at the beginning. The inverse sampling is not restricted to continuous distributions. $\endgroup$ Aug 8 '15 at 15:36
  • $\begingroup$ @StéphaneLaurent This is why I wrote that it is used for any distribution. But maybe there was too many changes and it got unclear. $\endgroup$
    – Tim
    Aug 8 '15 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.