[Python-checkins] cpython (merge 3.2 -> default): Issue 10787: Document the probability density function for random.gammavariate.
raymond.hettinger
python-checkins at python.org
Tue Mar 22 23:57:29 CET 2011
http://hg.python.org/cpython/rev/a892a0dd8190
changeset: 68848:a892a0dd8190
parent: 68844:29c8eb206076
parent: 68847:f882b284d260
user: Raymond Hettinger <python at rcn.com>
date: Tue Mar 22 15:57:03 2011 -0700
summary:
Issue 10787: Document the probability density function for random.gammavariate.
files:
Lib/random.py
diff --git a/Lib/random.py b/Lib/random.py
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -465,6 +465,12 @@
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
+
"""
# alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list