<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445</link>
    <title>MATLAB Central Newsreader - Gaussian Mixture</title>
    <description>Feed for thread: Gaussian Mixture</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 25 Mar 2009 03:00:04 -0400</pubDate>
      <title>Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637466</link>
      <author>Jose Valerio</author>
      <description>So,&lt;br&gt;
&lt;br&gt;
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&lt;br&gt;
&lt;br&gt;
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.</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 13:37:40 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637579</link>
      <author>Peter Perkins</author>
      <description>Jose Valerio wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; 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&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Hope this helps.</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 14:00:18 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637599</link>
      <author>Jose Valerio</author>
      <description>Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message &amp;lt;gqdc34$go5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Jose Valerio wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hope this helps.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
A method to generate random numbers from any distribution is based on the inverse function of&lt;br&gt;
the cdf of that distribution (see the below figure to understand the principle of the method).&lt;br&gt;
Use the method to generate 1000 samples distributed according to a Gaussian Mixture -&lt;br&gt;
distribution (GM), which consist of the weighted sum of two normal distributions N(-2,1) and&lt;br&gt;
N(2,1), with the corresponding weights of 0.4 and 0.6.&lt;br&gt;
Application For Data Analysis - 2 -&lt;br&gt;
Final Project Winter 2009&lt;br&gt;
&amp;#8226; Generate the two normal pdfs with function normpdf, just as previously. Plot the pdfs into&lt;br&gt;
a single figure.&lt;br&gt;
&amp;#8226; Calculate the weighted sum of these two pdfs, which is the GM-pdf. Plot the GM-pdf with&lt;br&gt;
the function plot &amp;#8211; does it look like the weighted sum of two normal distributions?</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 15:04:01 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637620</link>
      <author>Matt </author>
      <description>&quot;Jose Valerio&quot; &amp;lt;lapenda@gmail.com&amp;gt; wrote in message &amp;lt;gqdddi$mfe$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message &amp;lt;gqdc34$go5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Jose Valerio wrote:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; 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&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Hope this helps.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A method to generate random numbers from any distribution is based on the inverse function of&lt;br&gt;
&amp;gt; the cdf of that distribution (see the below figure to understand the principle of the method).&lt;br&gt;
&amp;gt; Use the method to generate 1000 samples distributed according to a Gaussian Mixture -&lt;br&gt;
&amp;gt; distribution (GM), which consist of the weighted sum of two normal distributions N(-2,1) and&lt;br&gt;
&amp;gt; N(2,1), with the corresponding weights of 0.4 and 0.6.&lt;br&gt;
&amp;gt; Application For Data Analysis - 2 -&lt;br&gt;
&amp;gt; Final Project Winter 2009&lt;br&gt;
&amp;gt; &amp;#8226; Generate the two normal pdfs with function normpdf, just as previously. Plot the pdfs into&lt;br&gt;
&amp;gt; a single figure.&lt;br&gt;
&amp;gt; &amp;#8226; Calculate the weighted sum of these two pdfs, which is the GM-pdf. Plot the GM-pdf with&lt;br&gt;
&amp;gt; the function plot &amp;#8211; does it look like the weighted sum of two normal distributions?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
A hint. You can do this with a combination of erf() and interp1()</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 16:20:17 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637645</link>
      <author>Jose Valerio</author>
      <description>&quot;Matt &quot; &amp;lt;xys@whatever.com&amp;gt; wrote in message &amp;lt;gqdh51$qju$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Jose Valerio&quot; &amp;lt;lapenda@gmail.com&amp;gt; wrote in message &amp;lt;gqdddi$mfe$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message &amp;lt;gqdc34$go5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Jose Valerio wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; 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&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hope this helps.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; A method to generate random numbers from any distribution is based on the inverse function of&lt;br&gt;
&amp;gt; &amp;gt; the cdf of that distribution (see the below figure to understand the principle of the method).&lt;br&gt;
&amp;gt; &amp;gt; Use the method to generate 1000 samples distributed according to a Gaussian Mixture -&lt;br&gt;
&amp;gt; &amp;gt; distribution (GM), which consist of the weighted sum of two normal distributions N(-2,1) and&lt;br&gt;
&amp;gt; &amp;gt; N(2,1), with the corresponding weights of 0.4 and 0.6.&lt;br&gt;
&amp;gt; &amp;gt; Application For Data Analysis - 2 -&lt;br&gt;
&amp;gt; &amp;gt; Final Project Winter 2009&lt;br&gt;
&amp;gt; &amp;gt; &amp;#8226; Generate the two normal pdfs with function normpdf, just as previously. Plot the pdfs into&lt;br&gt;
&amp;gt; &amp;gt; a single figure.&lt;br&gt;
&amp;gt; &amp;gt; &amp;#8226; Calculate the weighted sum of these two pdfs, which is the GM-pdf. Plot the GM-pdf with&lt;br&gt;
&amp;gt; &amp;gt; the function plot &amp;#8211; does it look like the weighted sum of two normal distributions?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A hint. You can do this with a combination of erf() and interp1()&lt;br&gt;
&lt;br&gt;
i have to use normpdf().&lt;br&gt;
So what I did was, &lt;br&gt;
x=-50:0.1:50  %These are my 1000 samples, or I could just do ramdom numbers&lt;br&gt;
y=normpdf(x,-2,1); %This is normal distributions N(-2,1)??? Here is where I'm a little confuse. What does the  N(-2,1) means?? is it a range od the mean -2 and Variace 1???&lt;br&gt;
plot(x,y)</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 17:41:01 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637674</link>
      <author>Matt </author>
      <description>&quot;Jose Valerio&quot; &amp;lt;lapenda@gmail.com&amp;gt; wrote in message &amp;lt;gqdlk1$l78$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Matt &quot; &amp;lt;xys@whatever.com&amp;gt; wrote in message &amp;lt;gqdh51$qju$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;Jose Valerio&quot; &amp;lt;lapenda@gmail.com&amp;gt; wrote in message &amp;lt;gqdddi$mfe$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message &amp;lt;gqdc34$go5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Jose Valerio wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; 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&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hope this helps.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; A method to generate random numbers from any distribution is based on the inverse function of&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the cdf of that distribution (see the below figure to understand the principle of the method).&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Use the method to generate 1000 samples distributed according to a Gaussian Mixture -&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; distribution (GM), which consist of the weighted sum of two normal distributions N(-2,1) and&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; N(2,1), with the corresponding weights of 0.4 and 0.6.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Application For Data Analysis - 2 -&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Final Project Winter 2009&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;#8226; Generate the two normal pdfs with function normpdf, just as previously. Plot the pdfs into&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; a single figure.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;#8226; Calculate the weighted sum of these two pdfs, which is the GM-pdf. Plot the GM-pdf with&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the function plot &amp;#8211; does it look like the weighted sum of two normal distributions?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; A hint. You can do this with a combination of erf() and interp1()&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; i have to use normpdf().&lt;br&gt;
&lt;br&gt;
I think you mean normcdf(). The instructions you posted are all about CDF's&lt;br&gt;
&lt;br&gt;
&amp;gt; So what I did was, &lt;br&gt;
&amp;gt; x=-50:0.1:50  %These are my 1000 samples, or I could just do ramdom numbers&lt;br&gt;
&amp;gt; y=normpdf(x,-2,1); %This is normal distributions N(-2,1)??? Here is where I'm a little confuse. What does the  N(-2,1) means?? is it a range od the mean -2 and Variace 1???&lt;br&gt;
&amp;gt; plot(x,y)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
N(-2,1) means a Gaussian distribution with mean -2 and variance 1</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 19:15:05 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637706</link>
      <author>Jose Valerio</author>
      <description>&amp;gt; &lt;br&gt;
&amp;gt; N(-2,1) means a Gaussian distribution with mean -2 and variance 1 &lt;br&gt;
Thanks, that help a little.&lt;br&gt;
&lt;br&gt;
So what I have up to now is:&lt;br&gt;
x = -2:0.01:2;&lt;br&gt;
y = normpdf(x,-2,1);&lt;br&gt;
plot(x,y)&lt;br&gt;
xi = normpdf(x,2,1);&lt;br&gt;
hold on&lt;br&gt;
plot(x,xi)&lt;br&gt;
figure&lt;br&gt;
plot(y,xi)&lt;br&gt;
&lt;br&gt;
I think I don't know what I'm doing, I'm so confused</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 19:38:01 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637712</link>
      <author>Matt </author>
      <description>&quot;Jose Valerio&quot; &amp;lt;lapenda@gmail.com&amp;gt; wrote in message &amp;lt;gqdvrp$6c1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; plot(y,xi)&lt;br&gt;
&lt;br&gt;
I don't understand your last line. Why is 'y' plotted on the x-axis?&lt;br&gt;
&amp;nbsp;</description>
    </item>
    <item>
      <pubDate>Wed, 25 Mar 2009 19:47:02 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#637715</link>
      <author>Jose Valerio</author>
      <description>&quot;Matt &quot; &amp;lt;xys@whatever.com&amp;gt; wrote in message &amp;lt;gqe16p$6lh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Jose Valerio&quot; &amp;lt;lapenda@gmail.com&amp;gt; wrote in message &amp;lt;gqdvrp$6c1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; plot(y,xi)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I don't understand your last line. Why is 'y' plotted on the x-axis?&lt;br&gt;
&amp;gt;  &lt;br&gt;
&lt;br&gt;
Never mind the last line. It should be the other way. Now I'm up to here:&lt;br&gt;
&lt;br&gt;
x = -5:0.1:5;&lt;br&gt;
y = normpdf(x,-2,1);&lt;br&gt;
plot(x,y)&lt;br&gt;
xi = normpdf(x,2,1);&lt;br&gt;
hold on&lt;br&gt;
plot(x,xi)&lt;br&gt;
&lt;br&gt;
r = y + xi;&lt;br&gt;
figure&lt;br&gt;
plot(r)&lt;br&gt;
&lt;br&gt;
figure&lt;br&gt;
cdf_sum = cumsum(y + xi);&lt;br&gt;
plot(cdf_sum)&lt;br&gt;
&lt;br&gt;
????</description>
    </item>
    <item>
      <pubDate>Wed, 01 Jul 2009 09:12:01 -0400</pubDate>
      <title>Re: Gaussian Mixture</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247445#661745</link>
      <author>liu s.h</author>
      <description>your code maybe correct!&lt;br&gt;
&lt;br&gt;
I want to ask if you have done this problem?&lt;br&gt;
&lt;br&gt;
Or you my have interest to talk about it?</description>
    </item>
  </channel>
</rss>

