np.random.normal(mean,sigma,size) allows to create a gaussian distribution based only on mean and variance. I want to create a distribution based on function_name(mean,sigma,skew,kurtosis,size).

I tried scipy.stats.gengamma but I don't understand how to use it. It takes 2 parameters - a,c and creates a distribution. But it is difficult to interpret for what values of a & c, the function will give a particular value of skewness and kurtosis.

Can anyone explain how to use gengamma or any other way to create such a distribution in python, even from scratch by writing mathematical equations?

Edit: By Gaussian, I mean that I want the distribution to be normal with some skewness or kurtosis as well. It need not be a standard normal distribution.

  • $\begingroup$ Reading your edit, I want to mention that every normal distribution has a skewness of $0$, a kurtosis of $3$, and an excess kurtosis of $0$. (I think scipy.stats.kurtosis calculates excess kurtosis.) If these are not the skewness, kurtosis, and excess kurtosis values of your distribution, your distribution is not normal. So what do you mean when you says you want a skewed normal distribution? $\endgroup$ – Dave May 13 at 2:58

The Gaussian distribution is fully described by its mean and variance. Gaussians have fixed values for Skewness (0) and Kurtosis (3) - so you can't really change them if you have made the Gaussian assumption for your model.

  • $\begingroup$ Please check the edits. I am new to this statistics field. I am sorry if I confused between some terminologies. $\endgroup$ – rb173 Apr 6 at 16:47
  • $\begingroup$ Try the skewnorm on scipy - docs.scipy.org/doc/scipy/reference/generated/… - Probably what you are looking for ? $\endgroup$ – Jayaram Iyer Apr 6 at 16:49
  • $\begingroup$ This is looking similar to gengamma. Can you please explain how should I use these functions? Let's say if I want to have a skewness of 4 and kurtosis of -2. Then what should be my parameter values for any of these functions as they don't take the input of skewness and kurtosis explicitly? $\endgroup$ – rb173 Apr 6 at 16:53
  • $\begingroup$ skewnorm takes a real number as a skewness parameter When a = 0 the distribution is identical to a normal distribution $\endgroup$ – Jayaram Iyer Apr 6 at 17:05
  • 1
    $\begingroup$ Then perhaps you are looing for the non-central Student's t distribution - that takes four parameters: df (degrees of freedom) - for kurtosis (nature of tailedness), nct (for skewness), loc (mean) and scale (standard deviation) - docs.scipy.org/doc/scipy/reference/generated/… $\endgroup$ – Jayaram Iyer Apr 6 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.