[docs] random.gammavariate doc incomplete

Georg Brandl georg at python.org
Sat Sep 17 20:36:45 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 31.08.2011 22:35, schrieb Catherine Beauchemin:
> 
> Dear maintainers,
> 
> The random.gammavariate online documentation at:
> 
> http://docs.python.org/library/random.html#random.gammavariate
> 
> is incomplete. At this page it currently states:
> 
> Gamma distribution. (Not the gamma function!) Conditions on the parameters
>  are alpha > 0 and beta > 0.
> 
> whereas the docstring for version 2.7 of random.gammavariate states:
> 
> Gamma distribution.  Not the gamma function!
> 
> Conditions on the parameters are alpha > 0 and beta > 0.
> 
> The probability distribution function is:
> 
> x ** (alpha - 1) * math.exp(-x / beta) pdf(x) =
> -------------------------------------- math.gamma(alpha) * beta ** alpha
> 
> 
> The definition of the pdf in the docstring is a must because otherwise it 
> is not possible to understand what the parameters alpha and beta of the 
> random.gammavariate function stand for (there are several definitions of 
> the gamma distribution in common use). Generally, I would think it would be
> best to explicitly write down the pdf(x) for all random variate functions
> to make it clear what the distribution parameters stand for.
> 
> So the online documentation should be updated to match the docstring for 
> random.gammavariate.

Thanks, this is now fixed.

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEARECAAYFAk506L0ACgkQN9GcIYhpnLAXkACfZ8qdlfZ9sLnVDmV8MF1v3wMa
NWQAoJaDIOK7LIhJCEiixT9EjHEIGB+U
=lpEP
-----END PGP SIGNATURE-----


More information about the docs mailing list