Is there a Python equivalent to MATLAB's pearsrnd function?
Asked Answered
H

1

7

I would like to generate random numbers with a given mean, variance, skewness, and kurtosis from the Pearson system. I can do this in MATLAB using "pearsrnd" -- does scipy, statsmodels, or any other package have a similar function?

Thanks in advance.

Headfirst answered 11/11, 2013 at 16:5 Comment(0)
C
4

In the new version (scipy >0.12.0), there is one: scipy.stats.pearson3. http://docs.scipy.org/doc/scipy-0.13.0/reference/generated/scipy.stats.pearson3.html

Calamus answered 11/11, 2013 at 19:45 Comment(2)
Yeah it looks like this is as close as it gets, with pearson3.rvs. Unfortunately it's only a Pearson III, which isn't exactly the same, but it should be good enough for my purposes. Really, MATLAB's 'pearsrnd' is a very strange function, I guess I'm not surprised it isn't widely available in other languages. Thanks for your help!Headfirst
You are welcome. The matlab version is quite unique in its own way, I totally agree. R provides Pearson distribution as well (in DAdist package). I think that one is more powerful than the scipy version.Calamus

© 2022 - 2024 — McMap. All rights reserved.