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 the data to a chosen model. 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

• A -- location = 1
• B -- scale = 2
• C -- shape = 3

The curve shown in the plot is the theoretical, not fitted model, obtained by specifying the initial parameters and setting them all Constant. When this dataset is considered to be a Gamma sample with unknown parameters, the maximum-likelihood parameters are found to be as follows:

• A = 1.08140
• B = 2.07122
• C = 2.87417

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