Generates binomially distributed random numbers.
Fortran:
status = virngbinomial( method, stream, n, r, ntrial, p )
C:
status = viRngBinomial( method, stream, n, r, ntrial, p );
The FORTRAN 77 interfaces are specified in the mkl_vsl.f77 include file, the Fortran 90 interfaces are specified in the mkl_vsl.f90 include file, and the C interfaces are specified in the mkl_vsl_functions.h include file.
Name |
Type |
Description |
---|---|---|
method |
FORTRAN 77: INTEGER Fortran 90: INTEGER, INTENT(IN) C: const int |
Generation method. The specific value is as follows: See brief description of the BTPE method in Table "Values of <method> in method parameter". |
stream |
FORTRAN 77: INTEGER*4 stream(2) Fortran 90: TYPE (VSL_STREAM_STATE), INTENT(IN) C: VSLStreamStatePtr |
Fortran: Descriptor of the stream state structure. C: Pointer to the stream state structure |
n |
FORTRAN 77: INTEGER Fortran 90: INTEGER, INTENT(IN) C: const int |
Number of random values to be generated |
ntrials |
FORTRAN 77: INTEGER Fortran 90: INTEGER, INTENT(IN) C: const int |
Number of independent trials m |
p |
FORTRAN 77: DOUBLE PRECISION Fortran 90: DOUBLE PRECISION, INTENT(IN) C: const double |
Success probability p of a single trial |
Name |
Type |
Description |
---|---|---|
r |
FORTRAN 77: INTEGER Fortran 90: INTEGER, INTENT(OUT) C: int* |
Vector of n binomially distributed random values |
The Binomial function generates binomially distributed random numbers with number of independent Bernoulli trials m, and with probability p of a single trial success, where p∈R; 0 ≤ p ≤ 1, m∈N.
A binomially distributed variate represents the number of successes in m independent Bernoulli trials with probability of a single trial success p.
The probability distribution is given by:
The cumulative distribution function is as follows:
Indicates no error, execution is successful.
stream is a NULL pointer.
stream is not a valid random stream.
Callback function for an abstract BRNG returns an invalid number of updated entries in a buffer, that is, < 0 or > nmax.
Callback function for an abstract BRNG returns 0 as the number of updated entries in a buffer.
Period of the generator has been exceeded.
Copyright © 1994 - 2011, Intel Corporation. All rights reserved.