Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27f8709

Browse files
committed
Issue 10787: Document the probability density function for random.gammavariate.
2 parents f047164 + a8e4d6e commit 27f8709

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/random.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,12 @@ def gammavariate(self, alpha, beta):
465465
466466
Conditions on the parameters are alpha > 0 and beta > 0.
467467
468+
The probability distribution function is:
469+
470+
x ** (alpha - 1) * math.exp(-x / beta)
471+
pdf(x) = --------------------------------------
472+
math.gamma(alpha) * beta ** alpha
473+
468474
"""
469475

470476
# alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2

0 commit comments

Comments
 (0)