I think the docstring of np.random.pareto (Version 1.8.0) is 
erroneous.  In a nutshell np.random.pareto draws samples from a
Lomax distribution with shape a and location m'=1.  To convert
those samples to a classical Pareto distribution with shape a and
location m you have to add 1 and multiply by m, instead of adding m as
stated in the docstring.

More specifically, the docstring says: 
"The Lomax or Pareto II distribution is a shifted Pareto distribution. The
classical Pareto distribution can be obtained from the Lomax distribution
by adding the location parameter m, see below."

Instead, it should read "[..] by adding 1 and multiplying my m, see below."

The example at the bottom therefore should read:

>>> a, m = 3., 1. # shape and mode
>>> s = (np.random.pareto(a, 1000) + 1) * m

Maybe an example with m=10 makes it clearer
>>> a, m = 3., 10. # shape and mode
>>> s = (np.random.pareto(a, 1000) + 1) * m

Additionally, calling m the location parameter could be misleading.
For simple Pareto (Type I) distributions it is usually referred to as
the x_min oder mode parameter of the distribution.  When discussing
generalized Pareto distributions m is usually called the scale
parameter (a constant factor) while mu is the location (an additive
term) [1].  I assume the misleading naming could have caused some
confusion and lead to the errors described above.

Last but not least I think it might also cause confusion to call
a function 'pareto' while its meaning is 'shifted by -1 pareto'. :)

[1] http://en.wikipedia.org/wiki/Generalized_Pareto_distribution

--
Conny Kuehne
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to