Wednesday, 27 March 2013

Inverse CDF method: Simulating random variates

Using the inverse CDF method, you can generate a random number from any of the 17 distributions supported by SciStatCalc by generating a uniformly distributed random number (which has a value between 0 and 1) as below,

Uniform Random Number Generator - double precision Tausworthe based algorithm - required six 32-bit integer seeds

and then copying and pasting the red result onto the probability field of the distribution of interest (swipe down first!), filling in the lower limit field (which will be either 0 or -inf, depending on the support of the distribution) and all the relevant parameter fields.

Press calculate to evaluate the upper limit - this value will be your desired random variate. These are shown below, for the case where we wish to generate a beta distributed random variable with alpha set to 1 and beta set to 2 - the result is approximately 0.3899.

inverse CDF method of simulating random variates