Random Numbers

<< Click to Display Table of Contents >>

Navigation:  Model Definition > Ventity Language > Functions >

Random Numbers

Previous pageReturn to chapter overviewNext page

 

Random Numbers

 

The seed value for the random number generator is set in Run Control. Generally these functions wrap their Math.net equivalents, so if you see a distribution function you need, please make a feature request via email. Where distributions are turncated by min and max values, draws are made by rejection sampling. If more than 10 rejections occur, the function falls back to a uniform distribution between the min and max bounds. Available distributions:

 

RandomUniform(min,max)

Random()

RandomUniform returns a random number uniformly distributed between min and max. Random() is shorthand for RandomUniform(0,1).

 

RandomNormal(mean,stdev[,min,max])

Returns a random number normally distributed around mean with standard deviation stdev. With four arguments, output is restricted to fall between min and max.

 

RandomBinomial(p,n)

RandomBinomal returns a number from a binomial distribution with success probability p and n trials. Equivalent to the sum of n calls to RandomBernoulli with probability p.

 

RandomBernoulli(p)

RandomBernoulli is equivalent to RandomBinomial(p,1) - i.e. a single trial with probability p.

 

RandomPoisson(mean[,min,max])

Returns a random number from a Poisson distribution with mean rate mean. With three arguments, output is restricted to fall between min and max.

 

RandomBeta(a,b)

A draw from the Beta distribution with parameters (a,b)

 

RandomExponential(x)

The Exponential distribution with rate parameter x

 

RandomGamma(shape, rate)

The Gamma distribution with specified shape and rate. Integer shapes yield the Erlang distribution, and Erlang(1) is Exponential.

 

RandomNegativeBinomial(p,n)

The Negative Binomial distribution with trial probability = p and trial failures = n.

 

RandomTriangular(lower,upper,peak)

A triangular distribution. Ordering should be lower < peak < upper.

 

RandomWeibull(shape, scale)

The Weibull distribution with specified shape and scale.

 

Random Distributions

 

See also

 

NormalCDF(value, mean, standardDeviation [, minrange, maxrange] )

The Cumulative Distribution Function of the Normal (Gaussian) distribution. If minrange and maxrange are supplied, the truncated normal is computed.

 

NormalLikelihood(value, mean, standardDeviation [, minrange, maxrange])

The density function or PDF of the Normal distribution, optionally truncated by [minrange, maxrange].