[R] generate random numbers subject to constraints

From: Ala' Jaouni <ajaouni_at_gmail.com>
Date: Wed, 26 Mar 2008 11:28:28 -0700

I am trying to generate a set of random numbers that fulfill the following constraints:

X1 + X2 + X3 + X4 = 1

aX1 + bX2 + cX3 + dX4 = n

where a, b, c, d, and n are known.

Any function to do this?


R-help_at_r-project.org 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 Wed 26 Mar 2008 - 18:35:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Mar 2008 - 22:30:26 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.

list of date sections of archive