Returns a deviate from a distribution whose relative probabilities are given by the values in the argument array. A new deviate is generated each time step.
Inputs: array of probabilities (real).
Outputs: index to value in array (int).
This can be used to make a deviate from an explicit set of probabilities where the pattern does not match any other built-in statistical function.
Result: A value from the binomial distribution with the given probability and number of trials. A new random deviate is generated each time step.
The binomial distribution describes the probability of a given number of positive outcomes occurring when a number n of trials are carried out, each with a certain probability p of a positive outcome.
Result: A value from the Poisson distribution with the given mean. A new random deviate is generated each time step.
The poisson distribution describes the probability of a given number of positive outcomes occurring in the limiting case of the binomial distribution, i.e., with very many trials each with a very small chance of a positive outcome.
Result: A random sample from a Gaussian (normal) distribution, with the supplied mean and standard deviation. A new random sample is generated each time step.
This function is implemented using a pseudo-random sequence generator; notes regarding its behaviour can be found in the documentation for the rand_var function.