.DESLib.RandomLib.Variates.GenerateVariateWrap

Information

GenerateVariate

Syntax

GenerateVariate(Cg1,Cg2,Cg3,Cg4,Cg5,Cg6,Bg1,Bg2,Bg3,Bg4,Bg5,Bg6,Ig1,Ig2,Ig3,Ig4,Ig5,Ig6,Anti,IncPrec,distribution,p1,p2,p3,p4)

Description

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

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

This function receives as parameters the individual components of a CMRG generator, instead of the record like in the GenerateVariate function.
It returns the updated state of the generator also with its individual components.

Examples

 (u,g.Cg1,g.Cg2,g.Cg3,g.Cg4,g.Cg5,g.Cg6,g.Bg1,g.Bg2,g.Bg3,g.Bg4,g.Bg5,g.Bg6,g.Ig1,g.Ig2,g.Ig3,g.Ig4,g.Ig5,g.Ig6,g.Anti,g.IncPrec) := 
GenerateVariate(g.Cg1,g.Cg2,g.Cg3,g.Cg4,g.Cg5,g.Cg6,g.Bg1,g.Bg2,g.Bg3,g.Bg4,g.Bg5,g.Bg6,g.Ig1,g.Ig2,g.Ig3,g.Ig4,g.Ig5,g.Ig6,g.Anti,g.IncPrec,2,0.4); // Generates a discrete variate (u) with Bernoulli(0.4) probability distribution. (u,g.Cg1,g.Cg2,g.Cg3,g.Cg4,g.Cg5,g.Cg6,g.Bg1,g.Bg2,g.Bg3,g.Bg4,g.Bg5,g.Bg6,g.Ig1,g.Ig2,g.Ig3,g.Ig4,g.Ig5,g.Ig6,g.Anti,g.IncPrec,) :=
GenerateVariate(g.Cg1,g.Cg2,g.Cg3,g.Cg4,g.Cg5,g.Cg6,g.Bg1,g.Bg2,g.Bg3,g.Bg4,g.Bg5,g.Bg6,g.Ig1,g.Ig2,g.Ig3,g.Ig4,g.Ig5,g.Ig6,g.Anti,g.IncPrec,11,0.4,0.6); // Generates a discrete variate (u) with Gamma(0.4,0.6) probability distribution. The example VariatesSimple2 uses of this function.

Interface

function GenerateVariateWrap
  input Real inCg1;
  input Real inCg2;
  input Real inCg3;
  input Real inCg4;
  input Real inCg5;
  input Real inCg6;
  input Real inBg1;
  input Real inBg2;
  input Real inBg3;
  input Real inBg4;
  input Real inBg5;
  input Real inBg6;
  input Real inIg1;
  input Real inIg2;
  input Real inIg3;
  input Real inIg4;
  input Real inIg5;
  input Real inIg6;
  input Integer inAnti;
  input Integer inIncPrec;
  input Integer distribution;
  input Real p1 = 0;
  input Real p2 = 0;
  input Real p3 = 0;
  input Real p4 = 0;
  output Real u;
  output Real Cg1;
  output Real Cg2;
  output Real Cg3;
  output Real Cg4;
  output Real Cg5;
  output Real Cg6;
  output Real Bg1;
  output Real Bg2;
  output Real Bg3;
  output Real Bg4;
  output Real Bg5;
  output Real Bg6;
  output Real Ig1;
  output Real Ig2;
  output Real Ig3;
  output Real Ig4;
  output Real Ig5;
  output Real Ig6;
  output Integer Anti;
  output Integer IncPrec;
end GenerateVariateWrap;

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