Grocer Function
NAME
bino_rnd - binomial random draws
CALLING SEQUENCE
[rnd]=bino_rnd(N,p,r,c)
PARAMETERS
Input
-
N = the # of trials (scalar)
-
p = the probability of success (scalar)
-
n = number of trials (scalar)
-
r,c = size of random sample from binominal(N,p) distribution (optional; default=1,1)
Output
- rnd =(rxc) matrix of random draws from the binomial (N,p) distribution, equal to the number of successes in n-trials
DESCRIPTION
Random sampling from a binomial distribution.
NOTE: mean = a/(a+b), variance = ab/((a+b)*(a+b)*(a+b+1))
EXAMPLES
1) x= bino_rnd(15,0.25,4,3)
2) x= bino_rnd(15,0.25)
Example 1 provides a (4x3) matrix of random draws from the binomial(5,15) law. Example 2 provides a scalar drawn for the same law.
AUTHOR
Eric Dubois 2002