The RAND(‘BINOMIAL’, p, n) function and the RANBIN(seed, n, p) function might return pseudo-random variates that do not adequately follow the Binomial distribution if n is large and p approaches 0 or 1.
Under the following conditions, a Normal approximation to the Binomial distribution is used by the RAND and RANBIN functions:
Otherwise, the Inverse Transform method is used. The Normal approximation to the Binomial distribution does not perform well when p approaches 0 or 1.
To circumvent the problem when n > 300, you can compute the sum of several Binomial random variates with n ≤ 300. For example, instead of specifying:
X=Rand(‘BINOMIAL’, p, 700);
you can run the equivalent code below to define your Binomial random variable, X:
X1=Rand(‘BINOMIAL’, p, 300);
X2=Rand(‘BINOMIAL’, p, 300);
X3=Rand(‘BINOMIAL’, p, 100);
X = X1+X2+X3;
Note: This behavior is observed under the aforementioned conditions with the RAND(‘BINOMIAL’, p, n) function for all of the random-number generators supported in the CALL STREAMINIT<(RNG, seed)>; subroutine.