# Generating random nos based on 'k' moments

How do I generate random nos based on say k moments? (no other constraints on support) When k = 2, we generate random nos. from a normal distribution defined by the 2 moments. Can we generalize this idea to an arbitrary k.

A related question: Is normal distribution the only (known) distribution which is defined by just 1st 2 moments?

(Editing the question based on a couple of answers I got)

I'll try to provide the context in which I thought of this question. I have a uni variate sample and no more information about anything. Now, I want to try and simulate nos. from the distribution from which this sample was drawn. I could just find its 1st 2 moments, assume this sample to be normally distributed, and be done. But if I want do away with 'Normal' assumption, I can try to find it's first k moments and somehow draw from the distribution defined by these k moments.

I am interested in its theoretical underpinnings as well as practical implementation.

-

There are many distributions that involve just one or two parameters and hence can be determined by just first or first and second moments. For example the exponential distribution is defined by its rate parameter which can be determined from the first moment.

Other distributions that may involve three or more parameters may need higher order moments to be determined. A method of estimation technique called the method of moments predates maximum likelihood and is based on solving equations that relate the model paremters to their moments. The moments are estimated from the data and then the equations are used to get the parameter estimated.

If you want to generate random numbers from a specific distribution that involves several parameters, it may be possible to specify the distribution based on the first few moments.

-

Moments and parameters are two different things. By using the limit k I presume you mean that the moments beyond moment k are all zero? The exponential distribution is skewed, so its third moment is not zero. If I recall correctly from studying moment generating functions, the Normal distribution is the only distribution in which moments beyond the second moment are all zero.

-
You must be thinking of cumulants. If any even moment (central or not) is zero, the distribution has to be a degenerate atom. – whuber Aug 14 '12 at 22:02
I was in fact confused whether Moments and parameter mean the same or not. Thanks @stevetnz for clarifying. – steadyfish Aug 16 '12 at 14:16
Yes and I don't think the OP is suggesting that higher order moments are 0. It is just that if you have k parameters and know the first k moments that can give you k equations in k unknowns to solve for MM estimates. Skewness is 0 but kurtosis is not and so the 4th moment of the normal is not zero. However all the higher moments can be expressed as functions of the first two. – Michael Chernick Aug 16 '12 at 14:18
I don't have much idea about MM but just wondering from your comment, the method you are describing will work when we know that the distribution is completely defined by k parameters (and hence k moments) and we can ignore all the higher moments after k. But this might not be possible when we don't know the distribution the sample belongs to. How can we use the moments here to define the distribution and simulate from it? Thanks. – steadyfish Aug 16 '12 at 15:05

So you want to simulate from a distribution given only empirically by some sample!

Is there any reason to not use the bootstrap? Or you could make a kernel density estimation, and then simulate from that! (If you are using a normal kernel function, that would be like sampling (with replacement) from the empirical distribution (that is, bootstrapping) and then adding a normally distributed "fuss" to each sampled value.

-
 I could use bootstrap in this scenario. Thanks for the suggestion. – steadyfish Aug 16 '12 at 14:13 Okay but the question was how to do this using moments. If you just want to simulate a distribution that is not knwon except for sample data then I think if the distribution is known to be discrete bootstrapping would be okay. But is you know that a density exists for the distribution then applying a smmothed version of the edf would be more appropriate. Sometimes that is called a smoothed bootstrap. – Michael Chernick Aug 16 '12 at 14:23 Agree with @MichaelChernick. I would want to use both the methods (bootstrap and from 'k' moments) to simulate, and compare the results in some way. – steadyfish Aug 16 '12 at 14:47