Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: cdf of mixture distributions?
Date: Mon, 13 Oct 2008 10:05:57 -0400
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <gcvkk5$ea8$1@fred.mathworks.com>
References: <6d5ff2bf-cf4a-4163-a293-5dcad79478ed@v56g2000hsf.googlegroups.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 1223906757 14664 172.31.57.88 (13 Oct 2008 14:05:57 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 13 Oct 2008 14:05:57 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
In-Reply-To: <6d5ff2bf-cf4a-4163-a293-5dcad79478ed@v56g2000hsf.googlegroups.com>
Xref: news.mathworks.com comp.soft-sys.matlab:494903


perfreem@gmail.com wrote:
> hello all,
> 
> is there a generic way to compute the cdf of bimodal distributions,
> say, a mixture of gaussians in matlab? example: p*normpdf(10, 5) + (1-
> p)*normpdf(10, 6). how can i get the cdf of this result, aside from
> brute force binning and summing?

It's the same idea, right?  If your mixture has two components, N(5,1) and N(6,1) (your example), with mixing probs [p 1-p], then the PDF at 10 is p*normpdf(10,5) + (1-p)*normpdf(10,6) and the CDF is p*normcdf(10,5) + (1-p)*normcdf(10,6).

Here's maybe a more interesting example:

xx = linspace(0,10,1000);
yy = .2*normcdf(xx,3) + (1-.2)*normcdf(xx,7);
plot(xx,yy);

Hope this helps.