Statistics Toolbox    
nbinstat

Mean and variance of the negative binomial distribution

Syntax

Description

[M,V] = nbinstat(R,P) returns the mean and variance of the negative binomial distribution with parameters R and P. Vector or matrix inputs for R and P must have the same size, which is also the size of M and V. A scalar input for R or P is expanded to a constant matrix with the same dimensions as the other input.

The mean of the negative binomial distribution with parameters r and p is rq/p, where q = 1-p. The variance is rq/p2.

The simplest motivation for the negative binomial is the case of successive random trials, each having a constant probability P of success. The number of extra trials you must perform in order to observe a given number R of successes has a negative binomial distribution. However, consistent with a more general interpretation of the negative binomial, nbinstat allows R to be any positive value, including nonintegers.

Example

See Also
nbincdf, nbinfit, nbininv, nbinpdf, nbinrnd


  nbinrnd ncfcdf