1

This is part of a question I had asked elsewhere, and then some of the links redirected me to CS stack exchange.

Given $a_1,\dots,a_D$ (all strictly positive), I want to draw points uniformly from

$\qquad X =\{(x_1, x_2, ..., x_D) \mid 0 \leq x_1 \leq x_2 \leq \dots \leq x_D\leq 1, \sum_{i=1}^D a_i x_i = 1 \} $

How do I achieve this? I would also like to understand how $x_1$ might be distributed over $[\frac {1} {\sum_i a_i}, \frac {1} {a_1}$] (a theoretical query).

This question solves it for $a_i=1$ and without the $x_i$'s having a prior order, but I do not see any obvious way to generalize from that answer.

There is a similar question on MO, but without the weights $a_1,\dots,a_D$.

Juanito
  • 111
  • 3
  • 2
    Simultaneously crossposted to mathoverflow - please don't do this. http://mathoverflow.net/questions/243687/uniform-sampling-from-general-simplex-with-a-twist – usul Jul 05 '16 at 03:17
  • I don't understand the definition of your set. I assume $x_n$ is a typo for $x_D$ but that's not super-important. What are the $a_i$? Are they a fixed parameter for the set? Are they existentially quantified for each element of the set? And what do you mean by a "good" way? Fast? Very close to uniform? Memory-efficient? Using only a few random bits? Something else? – David Richerby Jul 05 '16 at 10:21
  • @DavidRicherby $a_i$ are a fixed parameter of the set. By a good way, I first want to know what is the correct way theoretically. If you see the link to the "question I asked elsewhere", you would see that I started with a wrong way of dealing with this. From this question I would further like to understand how $x_1$ might be distributed over $[\frac {1} {\sum_i a_i}, \frac {1} {a_1}$] (once again a theoretical query) Finally, I think simulation wise I would like to know a fast way. I will edit the question a bit to make the language clearer. – Juanito Jul 05 '16 at 12:05
  • Please edit your clarifications into the question so people don't have to read the comments to find out what you mean. I've no idea what "the correct way theoretically" means -- that just sounds like "good" written in language that sounds more objective but isn't. – David Richerby Jul 05 '16 at 13:13
  • I do not come from a CS back ground, hence you have to forgive whatever lack of objectivity you are pointing to. That being said, are you telling me, that there are multiple ways of getting this done, and you would answer according to how I define this "objective" measure? Or are you just asking me to do this out of curiosity? – Juanito Jul 05 '16 at 22:01
  • If you look here (http://cs.stackexchange.com/questions/3227/uniform-sampling-from-a-simplex), the top answer would show you 2 correct and one incorrect way of doing things. I would say that the incorrect one is wrong incorrectly, because it never achieves uniform sampling, or anything close to it, irrespective of memory usage etc. – Juanito Jul 05 '16 at 22:03
  • I'm voting to close this question because it was cross-posted on MathOverflow. – D.W. Jul 06 '16 at 03:51

0 Answers0