Generate random variable with given moments I know first $N$ moments of some distribution. I also know that my distribution is continuous, unimodal and well shaped (it looks like gamma-distribution). Is it possible to:


*

*Using some algorithm, generate samples from this distribution, which in limit conditions will have exactly the same moments?

*Solve this problem analytically?
I understand that until I have an infinite number of moments, this question cannot have a unique solution. I would be happy to have any.
Due to the comments clarification:
I don't need to restore original distribution. I need ANY with a given moments.
 A: We really need that you give some more information as asked for in comments.
There is a monograph Recovery of Distributions via Moments  dedicated to your question.
Here: Constructing and Estimating Probability Distributions
from Moments  is another paper.
Some related posts on sister sites:
https://math.stackexchange.com/questions/386025/finding-a-probability-distribution-given-the-moment-generating-function
https://mathoverflow.net/questions/3525/when-are-probability-distributions-completely-determined-by-their-moments
Another paper is http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.106.6130  Its author lists some possible approaches, like maximum entropy methods (Jaynes 1994), a method of obtaining upper and lower bounds on the cumulative distribution function (cdf) using the first $n$ moments (https://www.semanticscholar.org/paper/A-moments-based-distribution-bounding-method-R%C3%A1cz-Tari/cd28087b8ead5c4d5c4eebc2b91e2a4b8caef3f3),  but then diced to assume a unimodal distribution and fit to a flexible distribution family, like Pearson family, Johnson family or Generalized Tukey Lambda family.  Finally she implements a solution based on fitting first four moments to the Generalized Lambda family.
