Núria Martínez wrote: > Dear all, > > I would like to know if there is a simple way to generate random numbers > with the constrain that they sum up to one. I am new using R... >
The easiest way is to generate them by whatever method and divide by their sum. e.g. as (s<-rexp(100))/sum(s) Are there other constraints, you need the numbers to satisfy? Obviously, they can't be independent. -- O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ 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.