Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fitdist for bimodal distribution

519 views
Skip to first unread message

Martijn

unread,
Jul 24, 2013, 3:48:23 AM7/24/13
to
Dear all,

I have a vector containing sizes obtained with measurements. When I make a histogram, it seems to be a bimodal distribution, so I would like to obtain the fit parameters for a lognormal distribution.

I tried this with fitdist('lognormal',data), but that fits a single lognormal distribution. Does any of you know how to do this for a bimodal distribution? Is that even possible with fitdist? Does anyone know a workaround?

I tried to fit the histogram (though this way I lose information) using fit(x,data,'gauss2') and fit(x,data,'lognormal'). The 'gauss2' fits a bimodal gaussian distribution, but I can't seem to find one for a bimodal lognormal distribution. Also, I prefer not to take this route, since I'm fitting the histogram instead of the raw data.

Thanks for any help!

Regards,
Martijn

Tom Lane

unread,
Jul 25, 2013, 5:14:40 PM7/25/13
to
> I tried this with fitdist('lognormal',data), but that fits a single
> lognormal distribution. Does any of you know how to do this for a bimodal
> distribution? Is that even possible with fitdist? Does anyone know a
> workaround?

There is no supported bimodal distribution in fitdist, aside from something
like the beta distribution which would probably not be appropriate in your
case.

There is an example of how to use the mle function to fit a mixture of two
distributions. Look on this page

http://www.mathworks.com/help/stats/examples/fitting-custom-univariate-distributions.html

for the title "Fitting a More Complicated Distribution: A Mixture of Two
Normal." You can adapt this to a distribution other than normal if you want.

If you do decide to fit a mixture of normal distributions, check out "help
gmdistribution.fit".

-- Tom

Martijn

unread,
Jul 29, 2013, 7:47:09 AM7/29/13
to
"Tom Lane" <tl...@mathworks.com> wrote in message <kss4g0$7dd$1...@newscl01ah.mathworks.com>...
Thank you Tom! That is exactly what I was looking for.
0 new messages