Find pdf of a random variable $Z$ which is a function of two random variables $X$ and $Y$.

143 Views Asked by At

Given two arbitrary positive constants $A$ and $B$, and two independent random variables $X$ and $Y$, I want to find out the pdf of $$Z=\frac{A+X}{B+Y}.$$


My process is as follows:

\begin{align} F_Z(z) &= \Pr\left\{Z \le z \right\} = \Pr\left\{\frac{A+X}{B+Y}\le z\right\}\\ &=\Pr\left\{X \le z(B+Y)-A \right\}\\ &= \int_{-\infty}^{\infty}\int_{-\infty}^{z(B+y)-A} f_{X,Y}(x,y)\,dx\,dy\\ &= \int_{-\infty}^{\infty}\int_{-\infty}^{z(B+y)-A} f_X(x) \cdot f_Y(y)\,dx\,dy.\\ \end{align}

By the Leibniz integral rule, \begin{align} f_Z(z) &= \frac{\partial}{\partial z} F_Z(z)\\ &= \int_{-\infty}^{\infty}\left(\frac{\partial}{\partial z}\int_{-\infty}^{z(B+y)-A}f_X(x) \cdot f_Y(y)\,dx\right)dy\\ &= \int_{-\infty}^{\infty}(B+y)\cdot f_X\left(z(B+y)-A\right) \cdot f_Y(y)\,dy\\ &= B\int_{-\infty}^{\infty}f_X\left(z(B+y-A\right)\cdot f_Y(y)\,dy + \int_{-\infty}^{\infty} y\cdot f_X\left(z(B+y)-A\right)\cdot f_Y(y)\,dy\\ \end{align}

Actually, if the process above is correct, $f_Z(z)$ must be non-negative whatever $A$, $B$, $z$ are, and $$\int_{-\infty}^{\infty}f_Z(z)\,dz$$ must be one. However, when I suppose that $X$ and $Y$ are i.i.d. Gaussian RVs, $f_Z(z)$ becomes negative despite having calculated $f_Z(z)$ three times. Is this just my calculation mistake? Is the process above correct?

2

There are 2 best solutions below

4
On

You cannot write $\frac {A+X} {B+Y} \leq z$ as $X \leq z(B+Y)-A$ so the first step is itself wrong. You have to write $\{\frac {A+X} {B+Y} \leq z \}$ as $\{X\leq z(B+Y)-A, B+Y>0\} \cup \{X\geq z(B+Y)-A, B+Y<0\}$ assuming that $Y$ is a continuous random variable ( so that $P\{B+Y=0)\}=0$).

2
On

The values of $X,Y$ that contribute to the same $Z$ are such that

$$Y=Z(A+X)-B.$$

Then taking $X$ as the independent variable

$$f_Z(z)=\int_{-\infty}^\infty f_X(x)\,f_Y(z(A+x)-B)\,dx.$$