Finding PDF and CDF and probability distribution for the transformation / change of RV

calculusprobability distributionsrandom variables

Consider a continuous RV $X$ with CDF $F_X(x) = e^{-(e^{-x})}$,
$\forall x \in R$ (note that $X$ takes values over the entire real line).
(a) Find the PDF of $X$
(b) Calculate the probability $P(|X| > 1)$.
(c) Define the transformation $Y = g(X) = e^{-X}$. Find the CDF of $Y$ and identity its distribution, i.e. give the name and parameter(s) of the distribution.

$\mathbf{My~Attempts:}$
(a) Let $f_X(x)$ be the PDF of $X$.
Since, by the $\mathbf{Properties~of~PDFs}$,
$~\hspace{11mm}$ we know that $F_X(x) = \int_{-\infty}^{x} f_X(u) du \implies f_X(x) = \frac{d}{dx} F_X(x) = F_X'(x)$.
So, I find that the PDF of $X$ is $f_X(x) = \begin{cases} e^{-x – e^{-x}}, & \text{if $x \geq 0$} \\ 0, & \text{if $x < 0$} \end{cases}$

(b) $P(|X| > 1) = P(X < -1 or X > 1) = 1 – P(-1 < X < 1) = 1 – (F_X(1) – F_X(-1)) \approx 0.3738$.

(c) I will use the PDF method which $f_Y(y) = \frac{f_X(g^{-1}(y))}{|g'(g^{-1}(y))|}$.
Since, $g^{-1}(y) = -log(y)$ and $g'(y) = -e^{-x}$.
So, $g'(g^{-1}(y)) = -e^{-(-log(y))} = -e^{log(y)} = -y$.
Also, $f_X(g^{-1}(y)) = e^{-(-log(y)) – e^{-(-log(y))}} = e^{log(y) – y} = y e^{-y}$.
So, $f_Y(y) = \frac{f_X(g^{-1}(y))}{|g'(g^{-1}(y))|} = \frac{y e^{-y}}{|-y|} = e^{-y}$.
Since, I know that the Exponential Distribution $Z \sim Exponential(\lambda)$ has PDF of $f(z) = \begin{cases} \lambda e^{-\lambda z}, & \text{if $z \geq 0$} \\ 0, & \text{if $z < 0$} \end{cases}$,
$~\hspace{100mm}$ for some $\lambda > 0$.
So, I observe that $\lambda = 1$ has PDF of $f(y) = \begin{cases} e^{-y}, & \text{if $y \geq 0$} \\ 0, & \text{if $y < 0$} \end{cases}$.
Therefore, I can say that $Y \sim Exponential(1)$. Also, the CDF would be $F_Y(y) = \int_{-\infty}^{y} f_{Y} (v) dv = 1 – e^{-y}$ because from the plot of $f(x) = e^{-x}$, I notice that $x = 0$ makes $f(x) = 1$ which is the maximum value of $f(x)$.

$\mathbf{Questions:}$
$\mathbf{Is~that~my~attempt~of~part~(a)~to~(d)~all~correct~?}$
$\mathbf{And~are~there~anything~I~can~improve~or~add~?}$
Also, I notice a problem with (c), since I want to use the CDF method to get CDF of Y which $F_Y(y) = P(Y \leq y) = P(X \leq g^{-1}(y)) = F_X(g^{-1}(y)) = F_X(-log(y)) = e^{-(e^{-(-log(y))})} = e^{-y}$. Which is not $1 – e^{-y}$. I am quite confuss on where I am doing wrong ?

Best Answer

$(a)$ is not correct. The CDF is non-constant over $\Bbb R$ so the PDF is not $0$ for $x<0$. It is $e^{-x-e^{-x}}$ over all of $\Bbb R$.


$(b)$ is okay.


Your answer to $(c)$ is okay because you have made an error here which offsets the error you made in part $(a)$. Note that in $(a)$, you took $X\ge0$ so $Y=e^{-X}\le1$. Thus the "PDF" you should have got is $e^{-y},0<y\le1$, which is not a PDF at all since it doesn't integrate to give $1$. The error you made here is that you didn't find the range of $Y$ according to the range of $X$ you wrote in $(a)$ and automatically assumed $Y\ge0$.

With the correct bounds on $X$ i.e. $-\infty<X<\infty$, $Y$ would vary from $0\to\infty$, which corresponds to the exponential dsitribution with parameter $1$.

So the PDF is$$f(y)=\begin{cases}e^{-y},&y>0\\0,&y\le0\end{cases}$$The CDF is$$F(y)=\int_{-\infty}^yf(u)du=\begin{cases}0,&y\le0\\\int_\color{red}0^yf(u)du=1-e^{-y},&y>0\end{cases}$$


The error you have made in the CDF approach is that $Y\le y$ does not translate to $X\le g^{-1}(y)$ for $g$ which is not strictly increasing. In our case, $Y\le y\iff e^{-X}\le y\iff -X\le\ln y\iff X\color{red}\ge-\ln y=g^{-1}(y)$.

So $P(Y\le y)=\begin{cases}0,&y\le0\\P(X\ge-\ln y),&y>0\end{cases}\\=\begin{cases}0,&y\le0\\1-P(X\le-\ln y),&y>0\end{cases}\\=\begin{cases}0,&y\le0\\1-F_X(-\ln y),&y>0\end{cases}$

which gives the same answer.

Related Question