Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
unimodal vs. bimodal distribution

Subject: unimodal vs. bimodal distribution

From: Luana Caselli

Date: 5 Sep, 2007 07:26:37

Message: 1 of 5

Hi!

Is there any statistics toolbox to test whether a data
dstribution is uni- or bi-modal?

Thanks!

Subject: unimodal vs. bimodal distribution

From: Tom Lane

Date: 5 Sep, 2007 15:21:21

Message: 2 of 5

> Is there any statistics toolbox to test whether a data
> dstribution is uni- or bi-modal?

Not exactly. The newest release does have the ability to fit mixtures of
Gaussian (normal) distributions. Among the outputs you can get is AIC, the
Akaike information criterion. Sometimes that is used as a rule (not really
a formal test) for picking a model. So if you're content to use normal
distributions, you could try something like this:

x = [randn(100,1); 3+randn(50,1)];
f1 = gmdistribution.fit(x,1) % single component, unimodal
f1.AIC
f2 = gmdistribution.fit(x,2) % two components, bimodal
f2.AIC

-- Tom

Subject: unimodal vs. bimodal distribution

From: Marion Wittmann

Date: 17 Jan, 2008 22:15:20

Message: 3 of 5

I have version 2007a, but can not find gmdistribution.fit

Is this function on yet a newer version?

Thank you,

marion wittmann

"Tom Lane" <tlane@mathworks.com> wrote in message
<fbmhhh$fnj$1@fred.mathworks.com>...
> > Is there any statistics toolbox to test whether a data
> > dstribution is uni- or bi-modal?
>
> Not exactly. The newest release does have the ability to
fit mixtures of
> Gaussian (normal) distributions. Among the outputs you
can get is AIC, the
> Akaike information criterion. Sometimes that is used as a
rule (not really
> a formal test) for picking a model. So if you're content
to use normal
> distributions, you could try something like this:
>
> x = [randn(100,1); 3+randn(50,1)];
> f1 = gmdistribution.fit(x,1) % single component, unimodal
> f1.AIC
> f2 = gmdistribution.fit(x,2) % two components, bimodal
> f2.AIC
>
> -- Tom
>
>

Subject: unimodal vs. bimodal distribution

From: Pekka

Date: 18 Jan, 2008 13:19:02

Message: 4 of 5

"Marion Wittmann" <marionmarionw@yahoo.com> wrote in
message <fmok1o$d61$1@fred.mathworks.com>...

gmdistribution is in statistics toolbox.
Do you have that?

> I have version 2007a, but can not find gmdistribution.fit
>
> Is this function on yet a newer version?
>
> Thank you,
>
> marion wittmann
>
> "Tom Lane" <tlane@mathworks.com> wrote in message
> <fbmhhh$fnj$1@fred.mathworks.com>...
> > > Is there any statistics toolbox to test whether a data
> > > dstribution is uni- or bi-modal?
> >
> > Not exactly. The newest release does have the ability
to
> fit mixtures of
> > Gaussian (normal) distributions. Among the outputs you
> can get is AIC, the
> > Akaike information criterion. Sometimes that is used
as a
> rule (not really
> > a formal test) for picking a model. So if you're
content
> to use normal
> > distributions, you could try something like this:
> >
> > x = [randn(100,1); 3+randn(50,1)];
> > f1 = gmdistribution.fit(x,1) % single component,
unimodal
> > f1.AIC
> > f2 = gmdistribution.fit(x,2) % two components, bimodal
> > f2.AIC
> >
> > -- Tom
> >
> >
>

Subject: unimodal vs. bimodal distribution

From: jugglernic@gmail.com

Date: 18 Jan, 2008 18:34:38

Message: 5 of 5

You could use Hartigan's dip statistic to test for unimodality.
I've got Ferenc Mechler's matlab implementation of the test on my
website:
http://www.nicprice.net/diptest/
I haven't put it on the matlab central file exchange because it's not
my code, but I understand that it is free for sharing. I'll see about
getting it onto the file exchange.

nic


On Jan 18, 8:19 am, "Pekka " <pekka.nospam.kumpulai...@tut.please.fi>
wrote:
> "Marion Wittmann" <marionmari...@yahoo.com> wrote in
> message <fmok1o$d6...@fred.mathworks.com>...
>
> gmdistribution is in statistics toolbox.
> Do you have that?
>
>
>
> > I have version 2007a, but can not find gmdistribution.fit
>
> > Is this function on yet a newer version?
>
> > Thank you,
>
> > marion wittmann
>
> > "Tom Lane" <tl...@mathworks.com> wrote in message
> > <fbmhhh$fn...@fred.mathworks.com>...
> > > > Is there any statistics toolbox to test whether a data
> > > > dstribution is uni- or bi-modal?
>
> > > Not exactly. The newest release does have the ability
> to
> > fit mixtures of
> > > Gaussian (normal) distributions. Among the outputs you
> > can get is AIC, the
> > > Akaike information criterion. Sometimes that is used
> as a
> > rule (not really
> > > a formal test) for picking a model. So if you're
> content
> > to use normal
> > > distributions, you could try something like this:
>
> > > x = [randn(100,1); 3+randn(50,1)];
> > > f1 = gmdistribution.fit(x,1) % single component,
> unimodal
> > > f1.AIC
> > > f2 = gmdistribution.fit(x,2) % two components, bimodal
> > > f2.AIC
>
> > > -- Tom

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us