MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: I look for a bi-modal distribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114533] Re: I look for a bi-modal distribution
  • From: Richard Hofler <rhofler at bus.ucf.edu>
  • Date: Tue, 7 Dec 2010 06:44:47 -0500 (EST)

Hello Alexei,

This adds a bit to what Andy wrote. Suppose you want to estimate the weights and parameters of each distribution of a component mixture distribution, where each distribution is Gaussian.

Mathematica 8 gives you at least two methods: EstimatedDistribution and FindDistributionParameters.

In[11]:== Clear[data]
data==RandomVariate[MixtureDistribution[{1/3,2/3},{NormalDistribution[0,1],
NormalDistribution[4,6]}],1000];

In[13]:== EstimatedDistribution[data,MixtureDistribution[{p,1-p}, {NormalDistribution[Subscript[\[Mu], 1],Subscript[\[Sigma], 1]], NormalDistribution[Subscript[\[Mu], 2],Subscript[\[Sigma], 2]]}]]//Timing

Out[13]== {12.75,MixtureDistribution[{0.643488,0.356512},{NormalDistribution[4.26783,
6.2886],NormalDistribution[0.0378801,1.04615]}]}



Clear[data]
data==RandomVariate[MixtureDistribution[{1/3,2/3},{NormalDistribution[0,1],
NormalDistribution[4,6]}],1000];

In[14]:== Clear[dist1]
dist1==MixtureDistribution[{p,1-p},{NormalDistribution[Subscript[\[Mu], 1],Subscript[\[Sigma], 1]],NormalDistribution[Subscript[\[Mu], 2],Subscript[\[Sigma], 2]]}];

In[16]:== FindDistributionParameters[data,dist1]//Timing

Out[16]== {12.703,{p->0.643488,Subscript[\[Mu], 1]
->4.26783,Subscript[\[Sigma], 1]->6.2886,Subscript[\[Mu], 2]->0.0378801,Subscript[\[Sigma], 2]->1.04615}}


Richard Hofler

-----Original Message-----
From: Andy [mailto:andyr at wolfram.com]
Sent: Sunday, December 05, 2010 9:50 PM
To: mathgroup at smc.vnet.net
Subject: [mg114533] [mg114462] Re: I look for a bi-modal distribution

On 12/4/2010 5:11 AM, Alexei Boulbitch wrote:
> Dear community,
>
> I have an experimental data list having the form of lst=={{x1, y1},...}.
> I make the analysis of statistics of the data. The distribution is
> non-Gaussian, as can be checked by various test criteria, and
> visualized by a histogram. I suspect however, that here there may be two
> superimposed Gaussian distributions in which both the means and the
> standard deviations are different.
>
> Among  the Mathematica built-in distributions in I did not succeed to
> find such a bi-modal distribution.  Do you know anything about such a
> distribution?
>
> Regards, Alexei
>
You can use MixtureDistribution to accomplish this. I'm assuming from
the structure of your data that this is a bivariate distribution.

dist == MixtureDistribution[ { w1, w2 },
{MultinormalDistribution[{mu11,mu12},Sigma1],
MultinormalDistribution[{mu21,mu22}, Sigma2]

Here the wi's are weights which determine how much each component
contributes to the overall distribution. Note that the Sigmai's are
covariance matrices. Also note that MixtureDistribution can take any
distributions you want, not just gaussian distributions.

You can estimate the parameters in the component distributions and the
weights with EstimatedDistribution.

Andy Ross
Wolfram Research


  • Prev by Date: Re: Counting number of numbers in a large list between two valus
  • Next by Date: Are these bugs fixed in Mathematica 8 ?
  • Previous by thread: Re: I look for a bi-modal distribution
  • Next by thread: Tempvar zombies littering my context!