[Python-checkins] cpython (merge 3.1 -> 3.2): Issue 10787: Document the probability density function for random.gammavariate.

raymond.hettinger python-checkins at python.org
Tue Mar 22 23:57:28 CET 2011


http://hg.python.org/cpython/rev/f882b284d260
changeset: 68847:f882b284d260
branch: 3.2
parent: 68843:40698c68a32c
parent: 68846:e880020e7e6a
user: Raymond Hettinger <python at rcn.com>
date: Tue Mar 22 15:56:41 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

AltStyle によって変換されたページ (->オリジナル) /