<< bincoef Supplementary distibution functions chis_pdf >>

Grocer >> Supplementary distibution functions > bino_rnd

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))

EXAMPLE

x= bino_rnd(15,0.25,4,3)
// Provides a (4x3) matrix of random draws from the binomial(5,15) law.
x= bino_rnd(15,0.25)
// Provides a scalar drawn for the same law.

AUTHOR

Eric Dubois 2002

Report an issue
<< bincoef Supplementary distibution functions chis_pdf >>