|
From: Christopher F. <ch...@tr...> - 2006-01-25 17:22:38
|
There appears to be a bug in the beta random number generator in numpy. A 2-parameter beta distribution has an expected value of a/(a+b). Hence, a beta(1,1) should have an expected value of 0.5 (since it is the equivalent of a uniform random variable on [0,1]). However, numpy gives the following: In [6]: from numpy.random import beta In [7]: from numpy import * In [8]: mean(beta(1,1,size=10000)) Out[8]: 0.33397400928538834 -- Christopher J. Fonnesbeck Population Ecologist, Marine Mammal Section Fish & Wildlife Research Institute (FWC) St. Petersburg, FL Adjunct Assistant Professor Warnell School of Forest Resources University of Georgia Athens, GA T: 727.235.5570 E: chris at trichech.us |