4

Let the dimension n=200 be fixed. The problem I am interested in is sampling points in n-dimensional Euclidean space uniformly from the region $$ \sum_{i=1}^{n} x_{i}\leq 1, $$ where $0\leq x_{i}\leq 1$ for all $1\leq i\leq n$.

One naive approach is to sample n points uniformly from the unit cube and then reject the sample if the sum is greater than 1. But this is a very inefficient approach. By simple MonteCarlo simulations I am observing that the Probability of the event $\sum_{i=1}^{n} x_{i}\leq 1$ is less than $10^{-6}$.

So is there any efficient way to do this sampling?

  • 2
    First sample $\sum_{i=1}^n x_i=S\in[0,1]$ using $p_S(s)\propto s^{n-1}$. Then sample uniformly from simplex $S=s$ using one of these algorithms. – A.S. Nov 12 '15 at 04:32
  • Btw, probability of $S\le 1$ for naive sampling is $\frac 1 {n!}$ which is much smaller than $10^{-6}$. – A.S. Nov 12 '15 at 04:41
  • 1
    Or, even simpler, sample uniformly from $\sum_{i=1}^{n+1}x_i=1$ and drop the last coordinate. – A.S. Nov 12 '15 at 05:16
  • I thought about the sampling from simplex and then scaling the norms in approppriate way so as to fill the region similar to sampling in a unit ball via sampling on a sphere first. But didn't know the property $p_{S}(s)\propto s^{n-1}$. Is it trivial to see this? – mathamateur Nov 12 '15 at 06:27
  • Yes. $S=s$ is a $n-1$ dimensional subspace, so its "volume" is proportional to the linear scale ($s$) to the power ${n-1}$. Scaling is similar to sphere/ball. – A.S. Nov 12 '15 at 06:38
  • Reading up on the simplices, volumes of the simplices and n-parallelepiped and the info already there on Stackexchange, this looks a silly question in hindsight :D

    Thanks A.S for all your help and pointing me towards the relevant links too. Appreciate it :)

    – mathamateur Nov 12 '15 at 19:03

0 Answers0