Dear all,

How can I simulate several random variables from a given density function? Assume a bivariate density function x+y defined for x >= 0 & x <= 1 & y >= 0 & y <= x.

The command may work something like this:

clear
set seed 1234
set obs 1000
f = x + y for x >= 0 & x <= 1 & y >= 0 & y <= x
gen x y = some command, denfun(f)

Any ideas would be highly appreciated.

Sincerely,
Alex