Commit 73dd7c71 authored by Georg Brandl's avatar Georg Brandl

Add info from the docstring for random.gammavariate() to the docs.

parent 75546069
...@@ -163,6 +163,7 @@ be found in any statistics text. ...@@ -163,6 +163,7 @@ be found in any statistics text.
The end-point value ``b`` may or may not be included in the range The end-point value ``b`` may or may not be included in the range
depending on floating-point rounding in the equation ``a + (b-a) * random()``. depending on floating-point rounding in the equation ``a + (b-a) * random()``.
.. function:: triangular(low, high, mode) .. function:: triangular(low, high, mode)
Return a random floating point number *N* such that ``low <= N <= high`` and Return a random floating point number *N* such that ``low <= N <= high`` and
...@@ -191,6 +192,12 @@ be found in any statistics text. ...@@ -191,6 +192,12 @@ be found in any statistics text.
Gamma distribution. (*Not* the gamma function!) Conditions on the Gamma distribution. (*Not* the gamma function!) Conditions on the
parameters are ``alpha > 0`` and ``beta > 0``. 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
.. function:: gauss(mu, sigma) .. function:: gauss(mu, sigma)
......
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