Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Gaussian Mixture
Date: Wed, 25 Mar 2009 14:00:18 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <gqdddi$mfe$1@fred.mathworks.com>
References: <gqc6nk$h5n$1@fred.mathworks.com> <gqdc34$go5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237989618 23022 172.30.248.35 (25 Mar 2009 14:00:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Mar 2009 14:00:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1731476
Xref: news.mathworks.com comp.soft-sys.matlab:527607


Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <gqdc34$go5$1@fred.mathworks.com>...
> Jose Valerio wrote:
> 
> > I have to generate 1000 samples distributed according to Gaussian Mixture distribution. And it has to consist of the sum of two distribution N(-2,1) and (2,1). weights of 0.4 and 0.6
> > 
> > I know that there is a method to generate the random numbers based on the inverse function of the cdf of that distribution and that's what I need to use, but I just can't figure it out.
> 
> You _can_ do that if that's what the homework assignment asks for, but there's a more obvious way.  Consider what a mixture model is:  a random value chosen from one of two probability distributions with (in your case) probabilities .4 and .6.  If that sounds like a constructive definition useful for generating a random value from the mixture, it is.
> 
> Hope this helps.

Ok, this is the whole asignment, but I can't find anything on my lectures that can help much with it. I've tried different ways and I still don't get it, maybe if it was worded a different way I would have a better chance of completing it.

A method to generate random numbers from any distribution is based on the inverse function of
the cdf of that distribution (see the below figure to understand the principle of the method).
Use the method to generate 1000 samples distributed according to a Gaussian Mixture -
distribution (GM), which consist of the weighted sum of two normal distributions N(-2,1) and
N(2,1), with the corresponding weights of 0.4 and 0.6.
Application For Data Analysis - 2 -
Final Project Winter 2009
&#8226; Generate the two normal pdfs with function normpdf, just as previously. Plot the pdfs into
a single figure.
&#8226; Calculate the weighted sum of these two pdfs, which is the GM-pdf. Plot the GM-pdf with
the function plot &#8211; does it look like the weighted sum of two normal distributions?