Transformation of random variables by method of CDF confusion My lecturer has given these instructions for transforming a random variable by method of CDFs:

The trouble is he doesn't specify much beyond this. Could anyone break these down and give a little more explanation? If possible, could an example be given with finding the sum of two uniform$(0,1)$ independent random variables?
 A: As you suggest, I can show how this would work for $U = Y_1 + Y_2$ where $Y_1$ and $Y_2$ are uniform on $(0,1)$.

*

*The function is for n = 2 random variables and let's call it $g$, so in this example, $g(y_1,y_2) = y_1 + y_2$, so by definition $U = g(Y_1,Y_2)$


*We want to find where $U=u$ in $(y_1, y_2)$ space, ie in general we will be solving for the set of $y$-values for which $g(y_1, y_2, ..., y_n) = u$ for any value of $u$.  In this case, $y_1 + y_2 = u$ which is just a straight line through $(0,u)$ and $(u,0)$.  This step is useful in helping to figure out the next step.


*Now we want $U \le u$, so $g(Y_1,Y_2) \le u$ which in this example would be $Y_1 + Y_2 \le u$.  This provides us with the region for the multi-variate integration in the next step.  In this case, in $(y_1,y_2)$-space this would be the intersection of the unit square and the triangle with sides given by the two axes and the line $y_1+y_2=u$ (as found in step 2).


*$F_U(u)$ is the cumulative density function of $U$ which by definition is $P(U\le u)$. We find that by using $f(y_1, y_2,...)$, the pdf of $Y_1, Y_2, ... $, and integrating over the region where $U \le u$, because that's how we find the probability that $g(Y_1, Y_2, ...) \le u$:
$\large \int...\int f(y_1, y_2,...) \space dy_1 dy_2 ...$ integrating over the region found in step 3.
For our example:
$p(U \le u) = \large \int_0^u \int_0^{u-y_2} f(y_1,y_2) \space dy_1 dy_2$
where $f(y_1, y_2) = 1$ for $0 \le y_1,y_2 \le 1$ and zero otherwise.
$p(U \le u)=\large \int_0^{\min(u,1)} \int_0^{\min(u-y_2,1)} 1 \space dy_1 dy_2$
You will need to make sure you understand how those limits work.
For $u \le 1$:
$p(U \le u)=\large \int_0^u \int_0^{\min(u-y_2,1)} 1 \space dy_1 dy_2$
$p(U \le u)=\large \int_0^u \min(u-y_2,1) \space dy_2$
$p(U \le u)=\large \int_0^u u-y_2 \space dy_2$
$p(U \le u)=\large [uy_2-\frac12y_2^2]_{y_2=0}^u$
$p(U \le u)=\frac12u^2$ (not too surprisingly, the area of a triangle with base and height of $u$)
For $1 < u < 2$:
$p(U \le u) = \large \int_0^1 \int_0^{\min(u-y_2,1)} 1 \space dy_1 dy_2$
which leads to
$p(U \le u) = \large \int_0^{u-1} 1 \space dy_2 + \int_{u-1}^1 u-y_2 \space dy_2$
which gets eventually to
$p(U \le u) = 2u - \frac12u^2-1$


*Finally, now we have the cdf, we can differentiate it to get the pdf, ie take the function we have just found:

$F_U(u)=\frac12 u^2$ for $u \le 1$
$F_U(u)=2u - \frac12u^2-1$ for $1 < u \le 2$
and differentiating with respect to $u$:
$f_U(u) = u$ for $u \le 1$
$f_U(u)=2-u$ for $1 < u \le 2$
