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

Compute mean and variance of the continuous uniform distribution.

Arguments

  • a is the first parameter of the continuous uniform distribution
  • b is the second parameter of the continuous uniform distribution

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

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

  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