How to put a collection of random variables in order? I have a collection of independent Gaussian random variables with unknown means and variances. I want to order them in the order of increasing mean value. For this, I want to come up with a score function that to a (small) sample sampled from a each of these random variables assigns its 'score'. For instance, I can take a sample mean as a value of this score function. But there could be other score functions, like, for instance, sample quantile values, etc. The order of random variables would be the order of the thus obtained scores. 
I will get to obtain an additional set of samples for the test. 


*

*I want to come up with a score function that will maximize the correctness of the order. What should be the target metric to maximize? Rank correlation between the scores on the train set and the sample means of the test set? 

*Would the score function that theoretically maximizes the target metric be a sample mean of on the train samples? 

*Any references that discuss this or similar problems would be very helpful. 
Thanks, 
 A: You can use mc-stan.org or https://docs.pymc.io/ for this. 
You need some prior on the mean and standard deviation for each variable. Input your observations. Then you sample posterior means and standard deviations for each of the random variables. Within each sample, determine the order of the random variables, and the distribution over these orders will give you a full probability estimate. 
If you don't like priors or you know absolutely nothing, and you have at least some observations, you can choose an almost flat prior. 
Hierarchical priors are almost always applicable to a realistic setting. 
As a bonus, this will give you an estimate of the probability of each of the orders. You can think of this information like the position matrix in this post: http://gijskoot.nl/bayesian/sports/soccer/predictions/pymc3/2018/02/07/knvb-model.html, the second from the top.
The problem discussed there is similar, the number of goals each soccer club makes is a random variable, you observe some data and you want to estimate their "real" scoring rate.  
