Re: Using scipy to fit a bimodal distribution
Paweł Kwaśniewski <[email protected]>
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <CAAih6W=BM0=3i0+XDonQib-pV7=WRJb1i+r2VgU=ihBfFBC=Og@mail.gmail.com> |
Hi Ashish, I can recommend lmfit: https://lmfit.github.io It's and additional module, so you'll need to install it, but it's worth it. It's well documented, easy to use and provides the possibility of creating composite models ( https://lmfit.github.io/lmfit-py/model.html#composite-models-adding-or-multiplying-models). I use it whenever I need to fit a double peak. It will also work with two different distributions. Cheers, Paweł 2018-03-16 8:14 GMT+01:00 spiff007 <[email protected]>: > Hi Folks, > > I have some data, which is bimodally distributed. > > The initial part of the data(in red, in the figure below), seems to be > exponentially distributed and the latter part(in blue, in the figure > below), seems to be a gamma distribution. > > See image below (& attached) : > > > > What scipy function, i could use to fit this data, knowing that, the first > mode is exponential, and the latter, seems to be gamma. > If its not possible to do it using scipy, is there another library/module > i could use to do this ? > > Any suggestions/pointers/advice/hacks ? > > Thanks a ton, > ashish > > -- > “The best minds of my generation are thinking about how to make people > click ads. That sucks.” > - Jeff Hammerbacher (early fb engineer) > > > _______________________________________________ > SciPy-User mailing list > [email protected] > https://mail.python.org/mailman/listinfo/scipy-user > > _______________________________________________ SciPy-User mailing list [email protected] https://mail.python.org/mailman/listinfo/scipy-user
Screenshot from 2018-03-16 12-38-02.png
(image/png, 79.2 KB) - not displayed