# PDF and CDF of the division of two Random variables

I have two RVs; their PDF are as the followings:

\begin{split} f_{X}(x) = \frac 1 {a} e^{-\frac x {a}}\end{split} and \begin{split} f_{Y}(y) = \frac {y^{L-1}} {b^{L} \Gamma (L)} e^{-\frac y {b}}\end{split}

where; a,b [Element] Reals && a,b > 0; L [Element] Integers && L >= 1;

Under the above conditions I want to calculated \begin{split} f_{Z}(z) \end{split} where \begin{split} Z = X/Y \end{split}

The PDF can be calculated as the follwing: $$f_Z(z) = \int_0^{\infty} y f_X(yz) f_Y(y) dy$$

And the CDF can be calculated as the follwing: $$F_Z(z) = \int_0^{\infty} \int_0^{yz} f_X(x) f_Y(y) dx dy$$ or $$F_Z(z) = \int_0^{\infty} F_X(yz) f_Y(y) dy$$

$$F_X(yz) = 1- e^{-\frac {yz} {a}}$$

Now to get the PDF of Z; the result for the above integration is: $$f_Z(z) = \frac {a^L*b*L} {(a+b*z)^{L+1}}$$

And the CDF of Z is:

$$F_Z(z) = 1-\left(\frac{a}{a+b z}\right)^L$$

How to check if these results are correct?

-
$Y$ is not exponential, it has a Gamma distribution. – Robert Israel Dec 9 '13 at 16:13
I usually do a numerical experiment with R (r-project.org) to validate derivations such as this. Sampling your two distributions (say, a thousand times), computing $X/Y$, and plotting the resulting distribution vs. the distribution you derived should only take a few lines of code in R. – fgp Dec 9 '13 at 16:24
What is the question actually? – Did Dec 9 '13 at 16:51
Where did parameter $c$ come from? – wolfies Dec 9 '13 at 17:33
@Did How to check if these results are correct? – sky-light Dec 10 '13 at 9:58

## 2 Answers

Simulate them. Write a quick computer program (Mathematica or Matlab (with Statistics toolbox) or octave) to simulate all three random variables, sample each 1000 times, and see if the associated empirical distributions are similar.

-
I hadn't seen @fgp's comment when I wrote this, which is essentially identical. Funny we both chose 1K samples. – John Dec 9 '13 at 16:38

It can be verified in Maple as follows: $$with(Statistics): X := RandomVariable(Exponential(a)): Y := RandomVariable(Gamma(b, L)): Z := X/Y; CDF(Z, t);$$ produces $$\cases{0&t\leq 0\cr - \left( bt+a \right) ^{-L}{a}^{L}+1&0<t\cr}.$$

-
could you tell me how to do this in Mathematica, or MatLab? – sky-light Dec 10 '13 at 10:06