Function File: [m, v] = nbinstat (n, p)

Compute mean and variance of the negative binomial distribution.

Arguments

  • n is the first parameter of the negative binomial distribution. The elements of n must be natural numbers
  • p is the second parameter of the negative binomial distribution. The elements of p must be probabilities

n and p must be of common size or one of them must be scalar

Return values

  • m is the mean of the negative binomial distribution
  • v is the variance of the negative binomial distribution

Examples

n = 1:4;
p = 0.2:0.2:0.8;
[m, v] = nbinstat (n, p)

[m, v] = nbinstat (n, 0.5)

References

  1. Wendy L. Martinez and Angel R. Martinez. Computational Statistics Handbook with MATLAB. Appendix E, pages 547-557, Chapman & Hall/CRC, 2001.
  2. Athanasios Papoulis. Probability, Random Variables, and Stochastic Processes. McGraw-Hill, New York, second edition, 1984.

Package: statistics