1
$\begingroup$

I have a variable which seems to be a mix of two Gaussian distributions (it is bi-modal with each mode looking normally distributed).

I would like to identify anomalous samples.

So my idea is to fit a GMM. Than I would like to see which points have a very low probability of coming from that model.

Does this make sense?

If yes, I'm aware that there could be different ways to do this python. Which would you recommend?

EDIT

I don't mean tests that would reject a uni-modal distribution. I am, actually, assuming that the process generating the data is multi-modal.

More specifically:

(1) I assume that data is coming from a finite Gaussian mixture (likely to be just two)

(2) I'm thinking of fitting such a model to the data (either by assuming that it is just 2 Gaussians or by estimating the number of components from the data)

(3) Then my thinking is to test which samples do not fit that hypothesis

Does this make sense?

If yes, which python packages would you suggest for such a pipeline?

$\endgroup$
3
  • $\begingroup$ Well, not really - as it is about R, not python $\endgroup$
    – Nick
    Commented Dec 29, 2019 at 14:13
  • $\begingroup$ Have you tried looking for some of the mentioned tests in Python? E.g. Google: "hartigan's dip test python" $\endgroup$
    – Stefan
    Commented Dec 29, 2019 at 14:17
  • $\begingroup$ The term sample has a particular meaning in statistics. When you say "samples" do you mean observations? $\endgroup$
    – Glen_b
    Commented Dec 30, 2019 at 2:32

0