[SciPy-User] Kurtosis/Skewness

Robert Kern robert.kern at gmail.com
Tue Mar 30 17:21:24 EDT 2010


On Tue, Mar 30, 2010 at 16:04, Dan bole <d.boles at hotmail.com> wrote:
> Hi all,
> I am trying to create a series of random variables selected from a
> distribution.  I would like this distribution to start as a normal
> distribution, but then be altered based on assumptions of skewness and
> kurtosis (so I am not calculating skewness/kurtosis from a dataset, but
> instead creating the probability density function from assumptions of
> skewness/kurtosis).  I can create a normal distribution and then pull random
> variables from this, and was wondering if it is possible to create a
> distribution based on assumptions of skewness and kurtosis?

There are an infinite number of distributions that will have the same
skewness and kurtosis. However, it is reasonable to search for the
maximum entropy distribution satisfying those constraints. The normal
distribution is the maximum entropy distribution for a fixed mean and
variance.

http://en.wikipedia.org/wiki/Maximum_entropy_probability_distribution

The PDF will have the form:

  pdf(x) = c * exp(- lagrange * (x ** arange(1, 5)))

c is just the normalizing constant. You will have to find the lagrange
parameters that satisfy the mean, variance, skewness and kurtosis.
Sampling from this distribution will be tricky, though. You will have
to resort to general methods that are going to be pretty slow.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the SciPy-User mailing list