This is an example of using Regress+ to generate** a sample of random variates from a specified distribution.

Regress+ has this capability because it must be able to assess the goodness-of-fit of an empirical dataset to a putative parent population. It performs that test by means of a parametric bootstrap, a kind of Monte Carlo simulation. It should be apparent that the synthetic sample (histogram) is a very good fit to the theoretical model (solid line).

Model

Gamma(A,B,C) = (1/(B Gam (C))) ((y - A)/B)^(C -1) exp ((A - y)/B)

where Gam (.) is the complete Gamma function.

Parameters

The curve shown in the figure is the theoretical model. When this dataset is considered to be a Gamma sample with unknown parameters, the maximum-likelihood parameters are found to be as follows:

The differences, from (1, 2, 3), are due to the natural variation inherent in drawing a sample of size 10,000 from this specific parent population.

This dataset is one of the examples included in the Regress+ software package.

** Gamma variates are generated using a rejection algorithm. For this example, execution time (on a 266-MHz G3 PowerMac) was about 2.5 seconds, most of which was disk I/O.