Transformation of random variable using CDF not making sense?
I have two exponential random variables $X,Y$ that are both identical (i.e. they have the same $\lambda$). I am attempting to find their sum using the method of CDFs (please note, I understand how to use the convolution but this is for completeness).
We have $f_X(x) = f_Y(y) = \begin{cases} \lambda e^{-\lambda x} & x \ge 0 \\ 0 & elsewhere \end{cases}$
The transformation we are given is $U = X+Y$.
Because $f_X(x) = f_Y(y)$, I propose we may treat this transformation as $U=2X$.
$F_U(u) = P(U\le u) = P(2X \le u) = P(X \le u/2) = F_X(u/2)$.
We know that the CDF of an exponential random variable is given by $F_X(x)= \begin{cases} 1-e^{-\lambda x} & x \ge 0 \\ 0 & elsewhere \end{cases}$
So $F_X(u/2) =\begin{cases} 1-e^{-\lambda u/2} & u \ge 0 \\ 0 & elsewhere \end{cases} $
Taking the derivative, we reach $f_U(u) = \begin{cases} (\lambda /2)e^{-\lambda u/2} & u \ge 0 \\ 0 & elsewhere \end{cases}$
But, when I solve by convolution I get $f_U(u) = \begin{cases} \lambda ^2ue^{-\lambda u} & u \ge 0 \\ 0 & elsewhere \end{cases}$
So I'm really unsure what's going on, any suggestions?
Solution 1:
You are doing by means of density and not by cdf. This is the way to do by cdf.
Let $U=X+Y$ where $X$ and $Y$ are iid exponential variates.
$$F_{U}(u)=P(U\leq u)=P(X+Y\leq u)=\mathbb{E}(\mathbb{E}(\mathbf{1}_{\{X\leq u-y\}})|Y=y))$$
$$=\int_{0}^{\infty}\int_{0}^{\infty}\lambda^{2}e^{-\lambda(x+y)}\mathbf{1}_{\{x\leq u-y,u-y\geq0\}}dxdy\\=\int_{0}^{u}\int_{0}^{u-y}\lambda^{2}e^{-\lambda(x+y)}\,dxdy\\=1-e^{-\lambda u}(1+\lambda u)\,,u\geq 0$$
(I have done this by means of indicators. You can just integrate the joint density over the region $\{x+y\leq u\}\cap[0,\infty)^{2}$ to get the same result)
That is :- $F_{U}(u)=\begin{cases}1-e^{-\lambda u}(1+\lambda u)\,,u\geq 0\\0\,,\text{otherwise}\end{cases}$.
So the density of $U$ is found by differentiating:-
$$f_{U}(u)=\lambda^{2}ue^{-\lambda u}\,,u\geq 0$$.
So $U\sim\text{Gamma}(2,\lambda)$
There are also other means of doing this. Perhaps the easiest is by Moment Generating Functions or Characteristic function.
The MGF of $X$ and $Y$ is :- $\frac{\lambda}{\lambda-t}$.
So the MGF of $X+Y = \left(\frac{\lambda}{\lambda-t}\right)^{2}=\left(\frac{1}{1-\frac{t}{\lambda}}\right)^{2}$
Which is the same as that of a $\text{Gamma}(2,\lambda)$ variate. And hence will share the same cdf with it.
More generally the sum of $n$ iid $\text{Exp}(\lambda)$ variates is a $\text{Gamma}(n,\lambda)$ variate.
Where $\text{Gamma}(\alpha,\beta)$ has the density :- $\frac{1}{\Gamma(\alpha)}\beta^{\alpha}x^{\alpha-1}e^{-\beta x}$