# distribution of one normal RV's rank within another normal distribution

This is a question originating from some research I'm doing on the discovery of correlations in a mass of time-series data.

Suppose I have a random variable $X$ that is normally distributed with mean $\mu_X$ and variance $\sigma^2_X$. In addition, I have i.i.d. random variables $Y_i$ ($1 \leq i \leq n$) that are also normally distributed, but with mean $\mu_Y$ and variance $\sigma^2_Y$. Typically, $\mu_X > \mu_Y$, and we can assume that's the case in this question.

I'm interested in the distribution of $X$'s rank within the $Y_i$—effectively, the number of $Y_i$ that are greater than $X$. Is there a straightforward way of obtaining even an approximate expression for this?

There is this question, but I'm not sure that's really sufficiently close to the same question. For one thing, it concerns only two samples, one drawn from each distribution, and for another, it gives only the probability that $X > Y$. This is of limited use in determining the distribution of $X$'s rank, since the event $X > Y_i$ is not in general independent of the event $X > Y_j$. However, if someone can articulate why an answer to that question will give me the answer to mine (or if there is another, more related question and answer), I'd be satisfied with that.

• Let $W$ be the number of $Y_i$ greater than $X$. Then $W|X = x \sim \text{Binomial}(n, 1 - F_Y(x))$. So $\displaystyle \Pr\{W = w\} = \int_{-\infty}^{+\infty} \binom {n} {w} (1 - F_Y(x))^w F_Y(x)^{n-w} f_X(x)dx$. This is the pmf of $W$ theoretically, but need other to help to find a way to compute this (approximately) for you. – BGM Apr 19 '17 at 4:33
• @BGM: Yes, sorry, I should've written the post to make it clear that I know how to obtain a theoretical expression of the kind you provide, but I would like something that is simpler to compute (and/or more intuitive) than integrating that numerically. Thanks for the thoughts, though! :-) – Brian Tung Apr 19 '17 at 5:34
• After running a bunch of simulations in R, it looks like $W$ is beta distributed but I have not been able to show that yet. – Therkel Apr 19 '17 at 9:18