Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Gaussian Mixture
Date: Wed, 25 Mar 2009 09:37:40 -0400
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <gqdc34$go5$1@fred.mathworks.com>
References: <gqc6nk$h5n$1@fred.mathworks.com>
NNTP-Posting-Host: perkinsp.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1237988260 17157 172.31.57.88 (25 Mar 2009 13:37:40 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Mar 2009 13:37:40 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
In-Reply-To: <gqc6nk$h5n$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:527587


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.