5

I want to generate data in Python that behaves like real stock market data, which means I need to be able to specify and play around with all of the first four moments. Only being able to control skewness or only kurtosis is unfortunately not enough.

I found some answers here: How to generate a distribution with a given mean, variance, skew and kurtosis in Python?, however I seem unable to gain control of the properties with the gengamma distribution.

I know there are tons of distributions here: https://docs.scipy.org/doc/scipy/reference/stats.html#continuous-distributions, maybe I can use one of them in some clever way? Or is there another way?

Chisq
  • 117
  • 1
  • 9

1 Answers1

0

I think you are better using the gengamma function in scipy since you have all the parameters to control the shape of the distribution.

from scipy.stats import gengamma

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gengamma.html

Hopes this helps.

dito
  • 129
  • 1
  • 6