trying to draw a random number from a distribution in SciPy, just like you would with stats.norm.rvs. However, I’m trying to take the number from an empirical distribution I have – it’s a skewed dataset and I want to incorporate the skew and kurtosis into the distribution that I’m drawing from. Ideally I’d like to just call stats.norm.rvs(loc=blah,scale=blah,size=blah) and then also set the skew and kurt in addition to the mean and variance. The norm function takes a ‘moments’ argument consisting of some arrangement of ‘mvsk’ where the s and k stand for skew and kurtosis, but apparently all that does is ask that the s and k be computed from the rv, whereas I want to establish the s and k as parameters of the distribution to begin with.
Anyway, I’m not a statistics expert by any means, perhaps this is a simple or misguided question. Would appreciate any help.
EDIT: If the four moments aren’t enough to define the distribution well enough, is there any other way to draw values that are consist with an empirical distribution that looks like this: https://i.stack.imgur.com/zia1r.png
If you are not worried about getting out into the tails of the distribution,
and the data are floating point, then
you can sample from the empirical distribution.
Basically, this is linearly interpolating in the empirical CDF to obtain
the random variates.
The two potential problems are (1) if your data set is small, you may not represent the
distribution well, and (2) you will not generate a value larger than the largest
one in your existing data set.
To get beyond those you need to look at parametric distributions, like the gamma distribution mentioned above.