KSLRandom
The purpose of this class is to facilitate random variate generation from various distributions without having to create object instances.
Each function marked rXXXX will generate random variates from the named distribution. The user has the option of supplying a RNStreamIfc as the source of the randomness. Functions that do not have a RNStreamIfc parameter use, defaultRNStream() as the default source of randomness. That is, they all share the same stream, which is the default stream from the default random number stream provider. The user has the option of supplying a stream number to identify the stream from the underlying stream provider. By default, stream 1 is the default stream for the default provider. Stream 2 refers to the 2nd stream, etc.
Also provides a number of methods for sampling with and without replacement from arrays and lists as well as creating permutations of arrays and lists.
Author
rossetti
Properties
Functions
Randomly selects from the array using the supplied cdf, NO checking of arrays
Each element must be in (0,1) and sum of elements must be less than or equal to 1.0.
There must be at least two elements in the supplied array. All elements must be probabilities within 0.0, 1.0. The sum of the probabilities must be 1.0
Makes an array that holds the probability mass function associated with the supplied discrete cumulative distribution function.
Randomly permutes the supplied array using the supplied stream number, the array is changed
Randomly permutes the supplied array using the supplied random number generator, the array is changed
Randomly permutes the supplied array using the supplied stream number, the array is changed.
Randomly permutes the supplied array using the supplied random number generator, the array is changed.
Randomly permutes the supplied List using the supplied stream number, the list is changed
Randomly permutes the supplied List using the supplied random number generator, the list is changed
Randomly select an element from the array
Randomly select from the list
Randomly selects from the array using the supplied cdf
Randomly selects from the list using the supplied cdf
Generates a discrete uniform over the range
Generates a N(0,1) random value using the supplied stream number
Generates a N(0,1) random value using the supplied stream
Generated a pair of normal random variates via the Box-Muller transform method The user can use destructuring to access the individual values
Generated a pair of normal random variates via the Box-Muller transform method The user can use destructuring to access the individual values
Pearson Type 6
Generates a continuous U(0,1) using the supplied stream number
Generates a continuous U(0,1) using the supplied stream
Generates a continuous uniform over the range
The array x is changed, such that the first sampleSize elements contain the generated sample. That is, x0, x1, ... , xsampleSize-1 is the randomly sampled values without replacement
The array x is changed, such that the first sampleSize elements contain the generated sample. That is, x0, x1, ... , xsampleSize-1 is the random sample without replacement
The array x is changed, such that the first sampleSize elements contain the sample. That is, x0, x1, ... , xsampleSize-1 is the random sample without replacement
The List x is changed, such that the first sampleSize elements contain the generate. That is, x.get(0), x.get(1), ... , x.get(sampleSize-1) is the random sample without replacement
The List x is changed, such that the first sampleSize elements contain the sampled values. That is, x.get(0), x.get(1), ... , x.get(sampleSize-1) is the random sample without replacement