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

Skip to content

Commit a8e4d6e

Browse files
committed
Issue 10787: Document the probability density function for random.gammavariate.
1 parent b199b22 commit a8e4d6e

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
@@ -470,6 +470,12 @@ def gammavariate(self, alpha, beta):
470470
471471
Conditions on the parameters are alpha > 0 and beta > 0.
472472
473+
The probability distribution function is:
474+
475+
x ** (alpha - 1) * math.exp(-x / beta)
476+
pdf(x) = --------------------------------------
477+
math.gamma(alpha) * beta ** alpha
478+
473479
"""
474480

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

0 commit comments

Comments
 (0)