The context is: I have a sequence of data, of which the histograms show a bi-modal pattern. My final goal is to sample from this sequence in a simulation project. Now we want to fit a parametric model (or two models) over the data. My question is

  • Is fitting parametric distribution over bi-modal data a good choice if my final goal is to sample from the data? shall I sample directly from the data? If so is there anything I shall pay special attention due to the bi-modal nature
  • If I want to fit parametric models, is there any python libraries doing such? Is there any way to automatically detect whether a sample is not uni-modal?

closed as too broad by Taylor, Michael Chernick, Jeremy Miles, Dimitris Rizopoulos, mkt May 10 at 8:58

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Sounds like your data fits the so called mixture model. From wikipedia:

In statistics, a mixture model is a probabilistic model for representing the presence of subpopulations within an overall population, without requiring that an observed data set should identify the sub-population to which an individual observation belongs

Answering your second point: There are some more rigorous ways of testing. Usually multimodal data will have a larger variance so this may be a sign for a closer look. I know that this is not the best practice but often I've seen people visually inspecting to detect bimodal for instance.

One popular algorithm is the EM which is implemented, for instance, assuming that both distributions are gaussian in GaussianMixture class of scikit-learn.

After fitting a GaussianMixture you can even call the sample() method and get your samples.


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