Distributions

oneAPI Math Kernel LibraryRNG routines are used to generate random numbers with different types of distribution. Each function group is introduced below by the type of underlying distribution and contains a short description of its functionality, as well as specifications of the call sequence and the explanation of input and output parameters. Table “Continuous Distribution Generators” and Table “Discrete Distribution Generators” list the random number generator routines with data types and output distributions, and sets correspondence between data types of the generator routines and the basic random number generators.

Type of Distribution

Data Types

BRNG Data Type

Description

onemkl::rng::uniform

s, d

s, d

Uniform continuous distribution on the interval [a,b)

onemkl::rng::gaussian

s, d

s, d

Normal (Gaussian) distribution

onemkl::rng::exponential

s, d

s, d

Exponential distribution

onemkl::rng::laplace

s, d

s, d

Laplace distribution (double exponential distribution)

onemkl::rng::weibull

s, d

s, d

Weibull distribution

onemkl::rng::cauchy

s, d

s, d

Cauchy distribution

onemkl::rng::rayleigh

s, d

s, d

Rayleigh distribution

onemkl::rng::lognormal

s, d

s, d

Lognormal distribution

onemkl::rng::gumbel

s, d

s, d

Gumbel (extreme value) distribution

onemkl::rng::gamma

s, d

s, d

Gamma distribution

onemkl::rng::beta

s, d

s, d

Beta distribution

onemkl::rng::chi_square

s, d

s, d

Chi-Square distribution

Type of Distribution

Data Types

BRNG Data Type

Description

onemkl::rng::uniform

i

d

Uniform discrete distribution on the interval [a,b)

onemkl::rng::uniform_bits

i

i

Uniformly distributed bits in 32-bit chunks

i

i

Uniformly distributed bits in 64-bit chunks

onemkl::rng::bits

i

i

Bits of underlying BRNG integer recurrence

onemkl::rng::bernoulli

i

s

Bernoulli distribution

onemkl::rng::geometric

i

s

Geometric distribution

onemkl::rng::binomial

i

d

Binomial distribution

onemkl::rng::hypergeometric

i

d

Hypergeometric distribution

onemkl::rng::poisson

i

s (for ) onemkl::rng::gaussian_inverse s (for distribution parameter λ≥ 27) and d (for λ < 27) (for onemkl::rng::ptpe)

Poisson distribution

onemkl::rng::poisson_v

i

s

Poisson distribution with varying mean

onemkl::rng::negbinomial

i

d

Negative binomial distribution, or Pascal distribution

onemkl::rng::multinomial

i

d

Multinomial distribution

Modes of random number generation

The library provides two modes of random number generation, accurate and fast. Accurate generation mode is intended for the applications that are highly demanding to accuracy of calculations. When used in this mode, the generators produce random numbers lying completely within definitional domain for all values of the distribution parameters. For example, random numbers obtained from the generator of continuous distribution that is uniform on interval [a,b] belong to this interval irrespective of what a and b values may be. Fast mode provides high performance of generation and also guarantees that generated random numbers belong to the definitional domain except for some specific values of distribution parameters. The generation mode is set by specifying relevant value of the method parameter in generator routines. List of distributions that support accurate mode of generation is given in the table below.

Parent topic: Random Number Generators