From: Alberto Monteiro <albmont_at_centroin.com.br>

Date: Wed 11 Oct 2006 - 21:04:08 GMT

hist(X)

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Oct 12 07:22:46 2006

Date: Wed 11 Oct 2006 - 21:04:08 GMT

I don't have the previous messages, but it seems to me that the solutions didn't quite get the requirements of the problem.

N <- 1000 M <- matrix(runif(2 * N), 2, N) X <- M[1,] / (M[1,] + M[2,])

hist(X)

"It's obvious that" for a generic n-th dimensional set of uniform variables X1, ... X_n subject to the restriction X1 + ... + X_n = 1, the solution is to take a uniform distribution in the (n-1)-th dimensional hyperpyramid generated by the above relation and the restrictions that each X_i >= 0.

For example, for n = 3, we should sample from the equilateral triangle with vertices c(1,0,0), c(0,1,0) and c(0,0,1).

For n = 4, we should sample from the pyramid whose vertices are c(1,0,0,0), c(0,1,0,0), c(0,0,1,0) and c(0,0,0,1).

I don't know if there is a simple formula to do this sampling.

Alberto Monteiro

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Oct 12 07:22:46 2006

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.1.8, at Wed 11 Oct 2006 - 22:30:10 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*