Distributions
Distributions#
oneMKL RNG 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.
Table Continuous Distribution Generators
Routine
Description
Uniform continuous distribution on the interval [
a,b
)Normal (Gaussian) distribution
Exponential distribution
Laplace distribution (double exponential distribution)
Weibull distribution
Cauchy distribution
Rayleigh distribution
Lognormal distribution
Gumbel (extreme value) distribution
Gamma distribution
Beta distribution
Chi-Square distribution
Normal Multivariate (Gaussian Multivariate) distribution
Table Discrete Distribution Generators
Type of Distribution |
Description |
---|---|
Uniform discrete distribution on the interval [ |
|
Uniformly distributed bits in 32/64-bit chunks |
|
Bits of underlying BRNG integer recurrence |
|
Bernoulli distribution |
|
Geometric distribution |
|
Binomial distribution |
|
Hypergeometric distribution |
|
Poisson distribution |
|
Poisson distribution with varying mean |
|
Negative binomial distribution, or Pascal distribution |
|
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 applications that are highly demanding to accuracy of calculations. When used in this mode, the generators produce random numbers lying completely within the 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 whata
andb
values may be. Fast mode provides high performance 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 the relevant value of the method parameter in generator routines. The list of distributions that support accurate mode of generation is given in the table below.
Table Distribution Generators with Accurate Method
Distribution |
Method |
---|---|
oneapi::mkl::rng::unform_method::accurate |
|
oneapi::mkl::rng::exponential_method::icdf_accurate |
|
oneapi::mkl::rng::weibull_method::icdf_accurate |
|
oneapi::mkl::rng::rayleigh_method::icdf_accurate |
|
oneapi::mkl::rng::lognormal_method::box_muller2_accurate, oneapi::mkl::rng::lognormal_method::icdf_accurate |
|
oneapi::mkl::rng::gamma_method::marsaglia_accurate |
|
oneapi::mkl::rng::beta_method::cja_accurate |
Parent topic: Random Number Generators