Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Greg Snow
Uwe Ligges > Cc: r-help; Alexander Engelhardt > Subject: Re: [R] How to draw 4 random weights that sum up to 1? > > > On Oct 10, 2011, at 12:44 PM, Uwe Ligges wrote: > > > > > > > On 10.10.2011 18:10, Alexander Engelhardt wrote: > >> Hey list, > &g

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread David Winsemius
On Oct 10, 2011, at 12:44 PM, Uwe Ligges wrote: On 10.10.2011 18:10, Alexander Engelhardt wrote: Hey list, This might be a more general question and not that R-specific. Sorry for that. I'm trying to draw a random vector of 4 numbers that sum up to 1. My first approach was something lik

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Uwe Ligges
On 10.10.2011 18:10, Alexander Engelhardt wrote: Hey list, This might be a more general question and not that R-specific. Sorry for that. I'm trying to draw a random vector of 4 numbers that sum up to 1. My first approach was something like a <- runif(1) b <- runif(1, max=1-a) c <- runif(1,

Re: [R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Greg Snow
; Subject: [R] How to draw 4 random weights that sum up to 1? > > Hey list, > > This might be a more general question and not that R-specific. Sorry > for > that. > > I'm trying to draw a random vector of 4 numbers that sum up to 1. > My first approach was something

[R] How to draw 4 random weights that sum up to 1?

2011-10-10 Thread Alexander Engelhardt
Hey list, This might be a more general question and not that R-specific. Sorry for that. I'm trying to draw a random vector of 4 numbers that sum up to 1. My first approach was something like a <- runif(1) b <- runif(1, max=1-a) c <- runif(1, max=1-a-b) d <- 1-a-b-c but this kind of