Skip to content
Prev 310121 / 398502 Next

how to generate a set of random numbers that sum to 1 with uniform distribution of elements

What uniform distribution do you want for the columns?  The average
value of X_k given \sum X_i = 1 must be 1/n.  If you start with 
X_i ~ U(0,1), the result must be skewed.

If you generate X_i uniformly distributed on (0, 2/n), the conditional
distribution given the sum is 1 will be less skewed.

  U <- matrix(runif(1000*100)/50,nrow=1000)
  s <- apply(U,1,sum)
  V <- U/s
  qqplot(U[,1],V[,1])

albyn
On Wed, Nov 07, 2012 at 05:02:10AM -0800, B?rbel wrote: