functionGenerateVariateWrap
Generates Variates
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:
- 1 = Constant
- 2 = Bernoulli
- 3 = Discrete Uniform
- 4 = Binomial
- 5 = Geometric
- 6 = Negative Binomial
- 7 = Poisson
- 8 = Uniform
- 9 = Exponential
- 10 = Erlang
- 11 = Gamma
- 12 = Weibull
- 13 = Normal
- 14 = LogNormal
- 15 = Beta
- 16 = Johnson (bounded and unbounded)
- 17 = Triangular
- other value = initalization of the generator (call to initGenerator() function).
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.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | inCg1 | ||
| Real | inCg2 | ||
| Real | inCg3 | ||
| Real | inCg4 | ||
| Real | inCg5 | ||
| Real | inCg6 | ||
| Real | inBg1 | ||
| Real | inBg2 | ||
| Real | inBg3 | ||
| Real | inBg4 | ||
| Real | inBg5 | ||
| Real | inBg6 | ||
| Real | inIg1 | ||
| Real | inIg2 | ||
| Real | inIg3 | ||
| Real | inIg4 | ||
| Real | inIg5 | ||
| Real | inIg6 | ||
| Integer | inAnti | ||
| Integer | inIncPrec | ||
| Integer | distribution | ||
| Real | p1 | 0 | |
| Real | p2 | 0 | |
| Real | p3 | 0 | |
| Real | p4 | 0 |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | u | ||
| Real | Cg1 | ||
| Real | Cg2 | ||
| Real | Cg3 | ||
| Real | Cg4 | ||
| Real | Cg5 | ||
| Real | Cg6 | ||
| Real | Bg1 | ||
| Real | Bg2 | ||
| Real | Bg3 | ||
| Real | Bg4 | ||
| Real | Bg5 | ||
| Real | Bg6 | ||
| Real | Ig1 | ||
| Real | Ig2 | ||
| Real | Ig3 | ||
| Real | Ig4 | ||
| Real | Ig5 | ||
| Real | Ig6 | ||
| Integer | Anti | ||
| Integer | IncPrec |