dask 2021.10.0

NotesParametersReturns
pareto(self, a, size=None, chunks='auto', **kwargs)

This docstring was copied from numpy.random.mtrand.RandomState.pareto.

Some inconsistencies with the Dask version may exist.

The Lomax or Pareto II distribution is a shifted Pareto distribution. The classical Pareto distribution can be obtained from the Lomax distribution by adding 1 and multiplying by the scale parameter m (see Notes). The smallest value of the Lomax distribution is zero while for the classical Pareto distribution it is mu , where the standard Pareto distribution has location mu = 1 . Lomax can also be considered as a simplified version of the Generalized Pareto distribution (available in SciPy), with the scale set to one and the location set to zero.

The Pareto distribution must be greater than zero, and is unbounded above. It is also known as the "80-20 rule". In this distribution, 80 percent of the weights are in the lowest 20 percent of the range, while the other 20 percent fill the remaining 80 percent of the range.

note

New code should use the pareto method of a default_rng() instance instead; please see the :None:ref:`random-quick-start`.

Notes

The probability density for the Pareto distribution is

$$p(x) = \frac{am^a}{x^{a+1}}$$

where $a$ is the shape and $m$ the scale.

The Pareto distribution, named after the Italian economist Vilfredo Pareto, is a power law probability distribution useful in many real world problems. Outside the field of economics it is generally referred to as the Bradford distribution. Pareto developed the distribution to describe the distribution of wealth in an economy. It has also found use in insurance, web page access statistics, oil field sizes, and many other problems, including the download frequency for projects in Sourceforge . It is one of the so-called "fat-tailed" distributions.

Parameters

a : float or array_like of floats

Shape of the distribution. Must be positive.

size : int or tuple of ints, optional

Output shape. If the given shape is, e.g., (m, n, k) , then m * n * k samples are drawn. If size is None (default), a single value is returned if a is a scalar. Otherwise, np.array(a).size samples are drawn.

Returns

out : ndarray or scalar

Drawn samples from the parameterized Pareto distribution.

Draw samples from a Pareto II or Lomax distribution with specified shape.

See Also

Generator.pareto

which should be used for new code.

scipy.stats.genpareto

probability density function, distribution or cumulative density function, etc.

scipy.stats.lomax

probability density function, distribution or cumulative density function, etc.

Examples

Draw samples from the distribution:

This example is valid syntax, but we were not able to check execution
>>> a, m = 3., 2.  # shape and mode  # doctest: +SKIP
... s = (np.random.pareto(a, 1000) + 1) * m # doctest: +SKIP

Display the histogram of the samples, along with the probability density function:

This example is valid syntax, but we were not able to check execution
>>> import matplotlib.pyplot as plt  # doctest: +SKIP
... count, bins, _ = plt.hist(s, 100, density=True) # doctest: +SKIP
... fit = a*m**a / bins**(a+1) # doctest: +SKIP
... plt.plot(bins, max(count)*fit/max(fit), linewidth=2, color='r') # doctest: +SKIP
... plt.show() # doctest: +SKIP
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/random.py#354
type: <class 'function'>
Commit: