GenerateVariate(distribution,g,p1,p2,p3,p4)
This function generates a random variate from the distribution indicated with the integer pararameter "distribution", using the following value correspondence:
(u,g) := GenerateVariate(2,g,0.4); // Generates a discrete variate (u) with Bernoulli(0.4) probability distribution. (u,g) := GenerateVariate(11,g,0.4,0.6); // Generates a continuous variate (u) with Gamma(0.4,0.6) probability distribution. The example VariatesSimple2 uses of this function.
function GenerateVariate input Integer distribution; input Generator g; input Real p1 = 0; input Real p2 = 0; input Real p3 = 0; input Real p4 = 0; output Real u; output Generator gout; end GenerateVariate;