ID 772987
Date 12/04/2020
Public

## Beta (VSL_RNG_METHOD_BETA_CJA/ VSL_RNG_METHOD_BETA_CJA_ACCURATE)

Random number generator of the beta distribution with two shape parameters p and q, offset a, and scale factor β. You can generate any successive random number Θ(p,q) of the standard gamma distribution (a = 0, β = 1) as follows:

1. If min(p,q) > 1, use Cheng algorithm. For details, see [Cheng78].

2. If max(p,q) < 1, apply a composition of two algorithms:

1. If q + K*P2 + C ≤ 0, where K = 0.852..., C = - 0.956..., use Jöhnk algorithm. For details, see [Jöhnk64].
2. Otherwise, use Atkinson switching algorithm. For details, see [Atkin79].
3. If min(p,q) < 1 and max(p,q) > 1, use the switching algorithm of Atkinson to generate random numbers. For details, see [Atkin79].

4. If p = 1 or q = 1, use the inverse transformation method.

5. If p = 1 and q = 1, standard beta distribution is reduced to the uniform distribution over the interval (0,1). The random numbers of the uniform distribution are generated using the VSL_RNG_METHOD_UNIFORM_STD method.

The algorithms of Cheng and Atkinson use acceptance/rejection technique. The beta distributed random number γ with the parameters p, q, a, and β is transformed from Θ(p,q) as follows: γ = a + βΘ(p,q)

See Intel® oneAPI Math Kernel Library Vector Statistics Random Number Generator Performance Data for test results summary.