Function File: [m, v] = gamstat (a, b)

Compute mean and variance of the gamma distribution.

Arguments

  • a is the first parameter of the gamma distribution. a must be positive
  • b is the second parameter of the gamma distribution. b must be positive

a and b must be of common size or one of them must be scalar

Return values

  • m is the mean of the gamma distribution
  • v is the variance of the gamma distribution

Examples

a = 1:6;
b = 1:0.2:2;
[m, v] = gamstat (a, b)

[m, v] = gamstat (a, 1.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