.DESLib.RandomLib.Variates.GenerateVariate

Information

GenerateVariate

Syntax

GenerateVariate(distribution,g,p1,p2,p3,p4)

Description

This function generates a random variate from the distribution indicated with the integer pararameter "distribution", using the following value correspondence:

Using this function, the generation of random variates in models can be easily parametrized.

Examples

 (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.



Interface

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;

Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos