Commit a8e4d6eb authored by Raymond Hettinger's avatar Raymond Hettinger

Issue 10787: Document the probability density function for random.gammavariate.

parent b199b226
...@@ -470,6 +470,12 @@ class Random(_random.Random): ...@@ -470,6 +470,12 @@ class Random(_random.Random):
Conditions on the parameters are alpha > 0 and beta > 0. 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 # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment