numpy.random selection from a loglogistic distribution?

Dear all, I'm a novice Python user, and I need to draw random variables from a loglogistic distribution. I've used the numpy.random command in the past to select variables from supported distributions (beta, normal, lognormal, etc). Is there a way to add in a distribution to be used with the numpy.random command? Thank you for your insight, Liz

On Mon, Jun 16, 2014 at 1:38 PM, Liz VanWormer <evanwormer@ucdavis.edu> wrote:
Dear all,
I'm a novice Python user, and I need to draw random variables from a loglogistic distribution. I've used the numpy.random command in the past to select variables from supported distributions (beta, normal, lognormal, etc). Is there a way to add in a distribution to be used with the numpy.random command?
You or someone can add new distribution for numpy.random. However, scipy has the fisk distribution which according to wikipedia is the same as log-logistic. fisk is implemented as a special case of burr and has an explicit inverse cdf (ppf) So using fisk.rvs should be reasonably fast for vectorized calls, since the overhead is much larger than for numpy.random functions. http://en.wikipedia.org/wiki/Log-logistic_distribution to make distribution names more fun: Wikipedia:"generalized log-logistic distribution" "These include the Burr Type XII distribution (also known as the Singh-Maddala distribution) " Josef
Thank you for your insight, Liz
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Dear Josef, Thank you for the excellent suggestion! Using fisk.rvs fixed the problem. Best wishes, Liz On Mon, Jun 16, 2014 at 1:05 PM, <josef.pktd@gmail.com> wrote:
On Mon, Jun 16, 2014 at 1:38 PM, Liz VanWormer <evanwormer@ucdavis.edu> wrote:
Dear all,
I'm a novice Python user, and I need to draw random variables from a loglogistic distribution. I've used the numpy.random command in the past to select variables from supported distributions (beta, normal, lognormal, etc). Is there a way to add in a distribution to be used with the numpy.random command?
You or someone can add new distribution for numpy.random.
However, scipy has the fisk distribution which according to wikipedia is the same as log-logistic. fisk is implemented as a special case of burr and has an explicit inverse cdf (ppf)
So using fisk.rvs should be reasonably fast for vectorized calls, since the overhead is much larger than for numpy.random functions.
http://en.wikipedia.org/wiki/Log-logistic_distribution
to make distribution names more fun: Wikipedia:"generalized log-logistic distribution" "These include the Burr Type XII distribution (also known as the Singh-Maddala distribution) "
Josef
Thank you for your insight, Liz
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (2)
-
josef.pktd@gmail.com
-
Liz VanWormer