Calculate distribution of function of random variable using total probability formula

263 Views Asked by At

Let Y be a function of the random variable X as follows: $$ Y= \left\{ \begin{aligned} X, & \quad X\ge 0 \\ X^2,& \quad X\le0 \end{aligned} \right. $$ compute $f_{Y}{(y)}$ in terms of $f_{X}{(x)}$, where $f_{X}{(x)}=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}$

I use total probability formula to derive an equation: $$ P(Y\le y) =P(Y\le y | X \ge 0)P(X\ge 0) + P(Y\le y | X \le 0)P(X \le 0) $$ Then: $$ P(Y\le y) = P(X \le y | X \ge 0)P(X\ge 0) + P(X^2 \le y | X \le 0)P(X\le 0) $$

Finally I derive cumulative distribution function $F_{Y}{(y)}$, and obtain $f_{Y}{(y)}$ from it.

However, my answer is not correct. I think the problem may lie in above two steps, so I was wondering if maybe anyone could point me out what is wrong with above two equitations?

2

There are 2 best solutions below

2
On BEST ANSWER

Note that, for $x\geq0$: $$[Y\le x]=[-\sqrt{x}\le X\le x]$$ Hence: $$F_Y(x)=F_X(x)-F_X(-\sqrt{x})$$ Differentiating: $$f_Y(x)=f_X(x)+\frac1{2\sqrt{x}}f_X(-\sqrt{x})$$ Now substitute.

5
On

What have you got for $f_Y(y)$ ? Using your method, I got $f_Y(y)=\dfrac{1}{\sqrt{2\pi}}\left(e^{-y^2/2}+\dfrac1{2\sqrt{y}}e^{-y/2}\right)$, for $y>0$ of course. Why isn't that correct ?