I am interested in generating a list of n random numbers that add up to 1 and are all non-negative, that is, a probability vector. As an example, I have tried the following simple approach:
n=10
v=rbeta(n,shape1=2,shape2=5)
v/sum(v)
However, I don't think this approach is correct, given that the number of degrees of freedom is n-1, instead of n.
Does anyone know how can this be done more correctly?
Thanks in advance for any help!