Compute mean and variance of the continuous uniform distribution.
Arguments
a and b must be of common size or one of them must be scalar and a must be less than b
- a is the first parameter of the continuous uniform distribution
- b is the second parameter of the continuous uniform distribution
Return values
- m is the mean of the continuous uniform distribution
- v is the variance of the continuous uniform distribution
Examples
a = 1:6; b = 2:2:12; [m, v] = unifstat (a, b) [m, v] = unifstat (a, 10)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.