Expected value of subset of variables in Bayesian setting Assume we have $N$ random variables $X_1, \ldots, X_N$ with known (posterior) distributions that are easy to sample from. For simplicity, assume that I am interested in the expected value of the ten largest of these random variables. There will be some uncertainty surrounding this expected value as there is uncertainty with respect to the rank of a given $X_i$ in case the distributions of $X_1, \ldots, X_N$ overlap. I want to use simulation based methods.
My approach is to simulate $M$ samples from the distributions of $X_1, \ldots, X_N$, where in each iteration, I construct a binary indicator of length $N$ indicating whether random variable $i$ is within the set of the ten largest samples or not. Averaging over these $M$ draws gives me the probability that random variable $i$ is member of the top ten group. Denote this probability as $\pi_i$. Define a binary random variable that indicates membership in the top ten group as $S_i$. $S_i$ follows a Bernoulli distribution s.t. $S_i \sim Ber(\pi_i)$.
In a second step, I draw $L$ samples from the distribution of $S_i$ and from the distributions of $X_1, \ldots, X_N$. Given a draw of $S_i$, I can select the top ten out of the samples of $X_1, \ldots, X_N$ in each iteration and average the respective samples within the top ten group. I save this average, so the result after $L$ iterations will be the distribution of the average outcome within the top ten group, taking into account all relevant sources of uncertainty.
My questions are: Is this simulation approach valid in general? From a Bayesian perspective, is this simulation valid or do I need to treat additional quantities (e.g. $S_i$ or $\pi_i$) as random variables that need a prior?
 A: 
Assume we have $N$ random variables $X_1,…,X_N$ with known (posterior)
distributions that are easy to sample from

I presume you mean posterior distribution (no "s") , $\pi$ say, since the variables (parameters?) have no reason to be independent a posteriori

the expected value of the ten largest of these random variables

This means computing $\mathbb E^\pi[X_{(N-9)}]$ using standard notations for order statistics. If the $X_i$'s are iid, the density of this order statistics is known. Else, this most likely requires simulation

some uncertainty surrounding this expected value as there is uncertainty with respect to the rank of a given $X_i$

There is randomness as to which index $i$ corresponds to $X_i$ being equal to $X_{(N-9)}$, but no uncertainty about $\mathbb E^\pi[X_{(N-9)}]$ for a given posterior

simulate $M$ samples from the distributions of $X_1,…,X_N$

Given a realisation of $X_1,…,X_N$, $X_{(N-9)}$ is easily derived by sorting and hence its average over the $M$ samples can be directly computed, approximating $\mathbb E^\pi[X_{(N-9)}]$

Averaging over these $M$ draws gives me the probability that random variable $i$ is member of the top ten group. Denote this probability as $π_i$

The average is a Monte Carlo approximation of the probability $π_i$

$S_i$ follows a Bernoulli distribution s.t. $S_i∼Ber(π_i)$

This is not the distribution of interest as the marginal distribution of $S_i$ does not account for the correlation between the $S_i$'s, as for instance ten and only ten of the $S_i$'s are equal to one

samples from the distribution of $S_i$ and from the distributions of $X_1,…,X_N$

The $S_i$'s are dependent of one another (see above) and of $X_1,…,X_N$"actually, given $X_1,…,X_N$, one knows exactly the $S_i$'s

Given a draw of $S_i$, I can select the top ten out of the samples of $X_1,…,X_N$

Same objection: given a realisation of $S_1,\ldots,S_N$, the distribution of the ten top $X_j$'s is modified, i.e., conditional on the fact that they are the top ten.

average the respective samples within the top ten group

This seems to differ from the earlier goal, i.e. aiming at
$$\mathbb E[\sum_{j=0}^9 X_{(N-j)}]$$
rather than $\mathbb E^\pi[X_{(N-9)}]$

From a Bayesian perspective

I do not see anything Bayesian in the problem, except that the distribution is called a posterior.
