Let $X$ have the exponential distribution with $\lambda=2$ Find the density function of the random variable $Y=\ln(X)$
I have an answer but I'm not sure if I'm doing it right: $f(x)$ is the pdf $f(x)=2e^{-2x}$, then, if the random variable $Y=\ln(X)$, then we simply substitute:
$P(Y \leq y)$=
$P(2e^{-2X} \leq y)$
$P(-4X \leq y)$ since $y=ln(x)$
$P(X \leq - \dfrac {1} {4} y)$
This is the distribution function, right?
Thanks!
Solution 1:
You can also attempt a change of variable. Since $Y = \log X$ is one-to-one over $(0,\infty)$, then $X = \exp\{Y\}$, and the density of $Y$ is $$f_Y(y) = \frac{f_X(e^y)}{\left|\frac{dy}{dx}\right|_{e^y}} = f_X(e^y)\left|\frac{dx}{dy}\right|_{e^y} = 2 e^{-2e^y}\cdot e^y = 2e^{-2e^y+y}.$$
Recall that $F_X(x) = 1-e^{-\lambda x}$. Then \begin{align*} P(Y<y) &= P(\log X <y)\\ &=P(X< e^y)\\ &=F_X(e^y)\\ &=1-e^{-2e^y}. \end{align*} Taking the derivative gives the density, $$f_Y(y) = -e^{-2e^y}\cdot (-2e^y) = 2e^{-2e^y+y}.$$
Solution 2:
When $Y=\ln X$, then you get the distribution function of $Y$ as follows: $$P(Y\leq y) = P(\ln X\leq y) = P(X\leq e^y)$$ Notice there is nothing weird going on. Instead of $Y$, I simply substitute $\ln X$, because they are equal. And in the last equality, I take the exponential on both sides of the inequality inside the probability.
But in the title, it seems like you are looking for the density, and not the distribution function, but I assumed you wanted to find the distribution function first.