0
$\begingroup$

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?
$\endgroup$

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

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