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.
Best Answer