Joint density function of iid exponential distribution? Let random variables $X_1$, $X_2$ and $X_3$ be independent and identically distributed
according to the exponential distribution with rate $\lambda$. Let $Y_1 = X_1$, $Y_2 = X_1 + X_2$,
and $Y_3 = X_1 + X_2 + X_3$.
(a) Find the joint density function of $Y_1$, $Y_2$ and $Y_3$.
(b) Find the marginal density of $Y_3$.
What do I do here? I don't really know where to start. Thank you for any help!
 A: (b) If $X_1, \dots, X_n \stackrel{iid}{\sim}\mathsf{Exp}(\mathrm{rate} = \lambda),$ then $T = \sum_{i=1}^n X_i \sim\mathsf{Gamma}(\mathrm{shape}= n, \lambda).$ This is easily proved using moment generating functions. (See Wikipedia on gamma distributions; the second parameterization, using rate, is used in R.)
By simulation of $m = 100\,000$ realizations of $T,$ each from summing $n=5$ independent $X_i \sim \mathsf{Exp}(.25),$ we have the following demonstration that
$T\sim\mathsf{Gamma}(5, .25)$ with $E(T) = n/\lambda = 20.$
set.seed(504)
t = replicate(10^5, sum(rexp(5, .25)))
summary(t)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.6922 13.5211 18.7286 20.0232 25.0858 81.6024 

hdr="Simulated sample of GAMMA(5, .25)"
hist(t, prob=T, br=20, col="skyblue2", main=hdr)
 curve(dgamma(x, 5, .25), add=T, col="orange", lwd=2)


A: Joint density means a specification of the density of the random variables as they would appear together, i.e. $g(Y_1, Y_2, Y_3)$. Marginal density means the density of one such variable alone, $g(Y_3)$.
a) Let us use the standard transformation lemma.
Inverse mappings give
$$\begin{split}s_1(Y_1, Y_2, Y_3)&=X_1=Y_1\\
s_2(Y_1, Y_2, Y_3)&=X_2=Y_2-Y_1\\
s_3(Y_1, Y_2, Y_3)&=X_3=Y_3-Y_1-(Y_2-Y_1)=Y_3-Y_2\end{split}$$
The absolute value of the Jacobian is, expanding across the first row, $$|J(s_1(Y_1,Y_2,Y_3), s_2(Y_1,Y_2,Y_3), s_3(Y_1,Y_2,Y_3))|=\operatorname{abs}\left(\begin{vmatrix}1&0&0\\-1&1&0\\0&-1&1\end{vmatrix}\right)=\operatorname{abs}\left(1\begin{vmatrix}1&0\\-1&1\end{vmatrix}\right)=|1|=1$$
The joint density of $X_1, X_2, X_3$ is
$$f(X_1,X_2,X_3)=\lambda e^{-\lambda X_1}\lambda e^{-\lambda X_2}\lambda e^{-\lambda X_3}$$
So the joint density of $Y_1, Y_2, Y_3$ is given by plugging in the inverse mappings and multiplying by the absolute value of the Jacobian,
$$\begin{split}g(Y_1,Y_2,Y_3)&=f(s_1(Y_1,Y_2,Y_3), s_2(Y_1,Y_2,Y_3), s_3(Y_1,Y_2,Y_3))\cdot |J(s_1(Y_1,Y_2,Y_3),s_2(Y_1,Y_2,Y_3),s_3(Y_1,Y_2,Y_3))|\\
&=\lambda^3e^{-\lambda(Y_1+Y_2-Y_1+Y_3-Y_2)}\cdot 1\\
&=\lambda^3e^{-\lambda Y_3}\end{split}$$
For what values are valid, we find that exponential rv's are only positive so
$$Y_1>0,Y_2-Y_1>0,Y_3-Y_2>0\Rightarrow Y_3>Y_2>Y_1>0$$
b) As mentioned (+1), the sum of $n$ independent exponential random variables with the same rate is $\text{Gamma}(n, \lambda)$, so here it is $Y_3\sim\text{Gamma}(3, \lambda)$. The density is $g(y_3)=\frac{\lambda^3}{2}x^2e^{-\lambda y_3},y_3>0$.
