Let's imagine I have a series of numbers that represents cash flows into some account over the past 30 days in some time window. This data is non-normal but it does represent some distribution. I would like to pull "new" numbers from this distribution in an effort to create a monte-carlo simulation based on the numerical data I have. How can I accomplish this? I've seen methods where you assume the data is normal & pull numbers based on some mean and standard deviation - but what about non-normal distributions? I'm using python so any reference including python or some python libraries would be appreciated.

  • $\begingroup$ Monte-carlo is used for arbitrary distribution ! $\endgroup$
    – user702846
    Commented Oct 6, 2020 at 21:46

1 Answer 1


If what you want is to generate random numbers with the same distribution as your cashflow numbers I recommend you using Python's Fitter package

It is powerful and very simple to use.

You can in this way use it to find the distribution of your data and then generate random numbers with the same distribution.

From documentation:

from scipy import stats
data = stats.gamma.rvs(2, loc=1.5, scale=2, size=10000)

from fitter import Fitter
f = Fitter(data)
# may take some time since by default, all distributions are tried
# but you call manually provide a smaller set of distributions

Also useful resources might be found in stackoverflow


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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