8000 DOC: fix a few bugs in the random.pareto docstring. Closes gh-4181. · rgommers/numpy@adeb220 · GitHub
[go: up one dir, main page]

Skip to content

Commit adeb220

Browse files
author
Ralf Gommers
committed
DOC: fix a few bugs in the random.pareto docstring. Closes numpygh-4181.
1 parent d3e8d69 commit adeb220

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

numpy/random/mtrand/mtrand.pyx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,12 +2551,12 @@ cdef class RandomState:
25512551
25522552
The Lomax or Pareto II distribution is a shifted Pareto distribution. The
25532553
classical Pareto distribution can be obtained from the Lomax distribution
2554-
by adding the location parameter m, see below. The smallest value of the
2555-
Lomax distribution is zero while for the classical Pareto distribution it
2556-
is m, where the standard Pareto distribution has location m=1.
2557-
Lomax can also be considered as a simplified version of the Generalized
2558-
Pareto distribution (available in SciPy), with the scale set to one and
2559-
the location set to zero.
2554+
by adding 1 and multiplying by scale parameter ``m`` (see Notes).
2555+
The smallest value of the Lomax distribution is zero while for the
2556+
classical Pareto distribution it is ``mu``, where the standard Pareto
2557+
distribution has location ``mu = 1``. Lomax can also be considered as a
2558+
simplified version of the Generalized Pareto distribution (available in
2559+
SciPy), with the scale set to one and the location set to zero.
25602560
25612561
The Pareto distribution must be greater than zero, and is unbounded above.
25622562
It is also known as the "80-20 rule". In this distribution, 80 percent of
@@ -2585,15 +2585,15 @@ cdef class RandomState:
25852585
25862586
.. math:: p(x) = \\frac{am^a}{x^{a+1}}
25872587
2588-
where :math:`a` is the shape and :math:`m` the location
2588+
where :math:`a` is the shape and :math:`m` the scale.
25892589
25902590
The Pareto distribution, named after the Italian economist Vilfredo Pareto,
25912591
is a power law probability distribution useful in many real world problems.
25922592
Outside the field of economics it is generally referred to as the Bradford
25932593
distribution. Pareto developed the distribution to describe the
25942594
distribution of wealth in an economy. It has also found use in insurance,
25952595
web page access statistics, oil field sizes, and many other problems,
2596-
including the download frequency for projects in Sourceforge [1]. It is
2596+
including the download frequency for projects in Sourceforge [1]_. It is
25972597
one of the so-called "fat-tailed" distributions.
25982598
25992599
@@ -2611,16 +2611,16 @@ cdef class RandomState:
26112611
--------
26122612
Draw samples from the distribution:
26132613
2614-
>>> a, m = 3., 1. # shape and mode
2615-
>>> s = np.random.pareto(a, 1000) + m
2614+
>>> a, m = 3., 2. # shape and mode
2615+
>>> s = (np.random.pareto(a, 1000) + 1) * m
26162616
2617-
Display the histogram of the samples, along with
2618-
the probability density function:
2617+
Display the histogram of the samples, along with the probability
2618+
density function:
26192619
26202620
>>> import matplotlib.pyplot as plt
2621-
>>> count, bins, ignored = plt.hist(s, 100, normed=True, align='center')
2622-
>>> fit = a*m**a/bins**(a+1)
2623-
>>> plt.plot(bins, max(count)*fit/max(fit),linewidth=2, color='r')
2621+
>>> count, bins, _ = plt.hist(s, 100, normed=True)
2622+
>>> fit = a*m**a / bins**(a+1)
2623+
>>> plt.plot(bins, max(count)*fit/max(fit), linewidth=2, color='r')
26242624
>>> plt.show()
26252625
26262626
"""

0 commit comments

Comments
 (0)
0