MATLAB: Regarding the PDF and CDF of two gamma distributed random varaibles!!

cdf

If X ~ gamma (m, p) with a shape parameter m and a scale parameter p and Y~ gamma (m, q) with a shape parameter m and a scale parameter q when X and Y are independent random variables then What will be the PDF and CDF of X+Y? How can I solve it in MatLab
Thanks in advance for help

Best Answer

The density function for X+Y is given by
f_X+Y(z)=exp(-q*z)*p^(2*m)/(gamma(m))^2*integral_{x=0}^{x=z}(x*(z-x))^(m-1)*exp(-(p-q)*x) dx
Use MATLAB's "integral" to evaluate the integral for different values of z.
Best wishes
Torsten.