Skip to content
Prev 273972 / 398506 Next

How to draw 4 random weights that sum up to 1?

You probably want to generate data from a Dirichlet distribution.  There are some functions in packages that will do this and give you more background, or you can just generate 4 numbers from an exponential (or gamma) distribution and divide them by their sum.