[R] generate random numbers subject to constraints

Ala' Jaouni ajaouni at gmail.com
Wed Mar 26 20:27:44 CET 2008


Hi,
I failed to mention that the X values have to be positive and between 0 and 1.

e.g.

0.1812*X1 + 0.1871*X2 + 0.1847*X3 + 0.2745*X4 + 0.1304*X5 = 0.2

so one possible combination of X values can be:
0.319, 0.201, 0.084, 0.26, 0.136

another possible combination:
0.151, 0.253, 0.197, 0.256, 0.143

The numbers should be uniformly distributed.

I might have misused the word random but I only need a subset of all
possible solutions.

-Ala'



More information about the R-help mailing list