Statistics Toolbox
  Go to function:
    Search    Help Desk 
nbinrnd    Examples   See Also

Random matrices from a negative binomial distribution.

Syntax

Description

RND = nbinrnd(R,P) is a matrix of random numbers chosen from a negative binomial distribution with parameters R and P. The size of RND is the common size of R and P if both are matrices. If either parameter is a scalar, the size of RND is the size of the other parameter.

RND = nbinrnd(R,P,m) generates random numbers with parameters R and P. m is a 1-by-2 vector that contains the row and column dimensions of RND.

RND = nbinrnd(R,P,m,n) generates random numbers with parameters R and P. The scalars m and n are the row and column dimensions of RND.

The negative binomial models consecutive trials each having a constant probability, P, of success. The parameter, R, is the number of successes required before stopping.

Example

Suppose you want to simulate a process that has a defect probability of 0.01. How many units might Quality Assurance inspect before finding three defective items?

See Also



[ Previous | Help Desk | Next ]