Function File: [m, v] = unidstat (n)
Compute mean and variance of the discrete uniform distribution.
Arguments
- n is the parameter of the discrete uniform distribution. The elements of n must be positive natural numbers
Return values
- m is the mean of the discrete uniform distribution
- v is the variance of the discrete uniform distribution
Example
n = 1:6; [m, v] = unidstat (n)References
- Wendy L. Martinez and Angel R. Martinez. Computational Statistics Handbook with MATLAB. Appendix E, pages 547-557, Chapman & Hall/CRC, 2001.
- Athanasios Papoulis. Probability, Random Variables, and Stochastic Processes. McGraw-Hill, New York, second edition, 1984.
Package: statistics