Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: convolve 2 probability distributions
Date: Wed, 25 Jun 2008 12:10:19 +0000 (UTC)
Organization: SwissRe
Lines: 41
Message-ID: <g3tcjb$2np$1@fred.mathworks.com>
References: <g3ra0s$g8k$1@fred.mathworks.com> <g3rjm6$79h$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1214395819 2809 172.30.248.38 (25 Jun 2008 12:10:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Jun 2008 12:10:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1231417
Xref: news.mathworks.com comp.soft-sys.matlab:475763



"matt dash" <n.a@mail.com> wrote in message <g3rjm6
$79h$1@fred.mathworks.com>...
> "Patrice Tscherrig" <patrice.tscherrig@gmx.ch> wrote in
> message <g3ra0s$g8k$1@fred.mathworks.com>...
> > Hi  - probably an easy one: 
> > 
> > How do I nummerically convolve 2 probability 
distributions
> > and see the resulting distribution? 
> > 
> > i.e.
> > P = [(0+eps):0.01:(1-eps)];
> > normint = norminv(P,0.05,0.005)
> > lognint = logninv(P,log(0.05),3);
> > X = lognpdf(lognint,log(0.05),3);
> > Y = normpdf(normint,0.05,0.005);
> > total = conv(X,Y);
> > figure,hist(total)
> > 
> > Leads not really to the result... Any help?
> > 
> > Patric
> 
> 
> Wouldn't it be easier to just sample from X and Y and do
> hist(x+y)? 

Matt, 

Well, Don't think that leads to what I want to achive. 
Given an empirical pdf1 and pdf2 I want to get out the 
empirical convolution of pdf1 and pdf2. With your 
suggestion: 
x=X(randint(1,1000,[1 100]));
y=Y(randint(1,1000,[1 100]));
figure,hist(x+y)

And looking at the empirial means and std's - not really 
what I expect after convolving the above two distributions. 

Any help?