TITLE: Help me get started on calculating CDFs/PDFs
QUESTION [0 upvotes]: Reading in a probability book. Lots of formulas, but almost no examples, and no classes to attend, so I'd like some help with figuring out CDFs and PDFs for transformations of two random variables.
Typically, I have problems when X and Y are random variables, and I am asked to find either the CDF of Z = XY or W = X/Y. 
The book gives the formula for the PDF, but not the CDF. 
$\textbf{Example}:$ 
(X,Y) is a random variable with pdf; $$p(x,y) = 24xy \ \ \  \text{when} \ \ \ 0 < x, x + y < 1$$
0 otherwise. 
Question: What is the CDF for Z = Y/X? Use this to find the pdf. 
My attempt: again, I only have formulas for the PDF, so I would look at the following integral $$\int_0^\infty p(x,zx)xdx$$. But a) how do I find the CDF first, and b) ignoring the CDF, what are the bounds on the integral written above (if I understand correctly, we need the bounds on x in terms of different values of z, or something of that sort?).

REPLY [0 votes]: To answer part a) of your question, if you want to work with CDFs you would first evaluate the integral 
$\int_0^{x} \int_0^y 24xydydx$
But for these types of transformations I often find it helpful to add a dummy variable and use the properties of joint transformations and then find the marginal distribution of $Z$ by simple integration. So let $W = X$ and $Z=\frac{X}{Y}$. 
We first want to find the joint density $f_{ZW}(z,w)$ and we know that for any joint pdf: 
$f_{ZW}(z,w) = f_{XY}(x(z,w), y(z,w))|J|$ 
where $|J|$ is the determinant of the Jacobian given by \begin{align*}
J
&= \begin{vmatrix}\frac{\partial Z}{\partial x}&&\frac{\partial Z}{\partial y}\\\frac{\partial W}{\partial x}&&\frac{\partial W}{\partial y}\end{vmatrix}\\\\
\end{align*}
Step 1: Find Jacobian
\begin{align*}
J &= \begin{vmatrix}\frac{1}{Y}&&\frac{-X}{Y^2}\\1&&0\end{vmatrix}\\\\
\end{align*}
Thus $|J| =\frac{1}{Y}*0 - \frac{-X}{Y^2} = \frac{X}{Y^2}$
so now we have that 
$f_{ZW}(z,w) = f_{XY}(x(z,w), y(z,w))\frac{X(z,w)}{Y^2(z,w)}$ 
Step 2: Solve for $X,Y$
Clearly we have that $X=W$ and $Y=\frac{W}{Z}$
Step 3: Plug what you have into the distribution
$f_{ZW}(z,w) = 24w(\frac{w}{z})\frac{X(z,w)}{Y^2(z,w)} = 24w(\frac{w}{z}) \frac{w}{(w/z)^2} = 24zw$ 
Step 4: (IMPORTANT) That's a nice looking pdf but you need to solve for bounds on variable you want to integrate out:
We have that this distribution is nonzero if $x > 0$ and $ x + y < 1$ so this translates to $w>0$ and $w < \frac{z}{z+1}$
Step 5: Find Marginal Distribution of $Z$, i.e. use the bounds found above to evaluate the integral: 
$\int_0^{\frac{z}{z+1}} 24zwdw$
And that gives you the PDF, or "marginal PDF",for $Z$. The last thing I usually do is check that this satisfies the definition of the pdf. 
Step 6: Not necessary, but if the question wants the CDF just solve:
$F_{Z}(z) = P(Z \leq z) = \int_0^z\int_0^{\frac{z}{z+1}} 24zwdwdz$
Let me know if you need more details.
{"set_name": "stack_exchange", "score": 0, "question_id": 1111850}