convolution of two probability density functions
이전 댓글 표시
I am considering two exponential probability distribution functions with mean equal to 5 and 3.
pdf1=@(x)exppdf(x,5);
pdf2=@(x)exppdf(x,3);
I want to compute the pdf of the sum of these two densities using convolution:
x=0:100;
uh=conv(pdf1(x),pdf2(x));
Since the step-size of x is one, uh should be a density and the area under uh should be one. But
trapz(0:200,uh)
yields 1.26.
But when I choose x=0:0.1:100;
trapz(0:0.1:200,uh)*0.1
yields 1.026.
So, it turns out that the accuracy of 'using 'conv' to the get the density of the sum of two independent random variables' depends heavily upon the support chosen. Am I doing it correct or there is something wrong with my approach. Is there an automatic way to select a reasonable support for the convolution of two densities.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!