# Finding the probability density function of $Y=e^X$, where $X$ is standard normal

Let the random variable $X$ have the $N(0,1)$ distribution for which the probability function is: $$f(x)= \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{x^2}{2}\right), -\infty< x <\infty$$ Let $Y=e^X$.

A. Find the probability density function for $Y$,

B. Find $E(Y)$,

C. Find $E(Y^2)$ and deduce $\mathrm{Var}(Y)$.

B and C I can do if I find A but can anybody explain to me how this is done. The logic behind it.

## 3 Answers

To find the density function $f_Y(y)$ of $Y$, one strategy is to find the cumulative distribution function $F_Y(y)$, and then differentiate. Note that $Y$ is always positive, so $F_Y(y)=0$ if $y\le 0$. Now suppose that $y\gt 0$. Then $$F_Y(y)=\Pr(Y\le y)=\Pr(e^X\le y)=\Pr(X\le \ln y).$$ Thus $$F_Y(y)=\int_{-\infty}^{\ln y}f(x)\,dx.$$ To find the density, differentiate. We do this by differentiating under the integral sign, that is, by using the Fundamental Theorem of Calculus. We get $$f_Y(y)=\frac{1}{y}f(\ln y).$$

Remark: To find $E(Y)$, I would suggest not using the density. Easier, I think, is to use $$\int_{-\infty}^\infty e^x f(x)\,dx.$$ Apart from a constant, we are integrating $e^{-(x^2-2x)/2}$. Complete the square, and make the substitution $u=x-1$.

• Shouldnt you be more consistent by using $\ln$ instead of $\log$? – Don Nov 16 '15 at 19:39
• @Don: Thank you, I had not noticed. – André Nicolas Nov 16 '15 at 20:07
• I don't think your first integral is quite correct. The fundamental theorem requires the parameter and the upper limit of integration to be the same. $F_Y(\ln(y))$ on the left-hand side would make it correct. – Joseph Garvin Jun 10 '18 at 20:56

The cumulative distribution function of $Y$ is $$F_Y(y)=P(Y\leq y)=P(e^X\leq y)$$ which is $0$ when $y\leq 0$, and when $y>0$ then $$P(e^X\leq y)=P(X\leq\log(y))=\int_{-\infty}^{\log(y)}f_X(x)\,\mathrm dx=F_X(\log(y)).$$ Differentiating $F_Y(y)$ we obtain the density of $Y$: $$f_Y(y)=F'_X(\log(y))\frac{1}{y}=f(\log(y))\frac{1}{y}=\frac{1}{y\sqrt{2\pi}}\exp\left(-\frac{\log(y)^2}{2}\right),\quad y>0,$$ and $f_Y(y)=0$ for $y\leq 0$.

The simplest way is to use the change of variable formula for continous random variables $$f_Y(y) = f_x(x) \; \left| \frac{dx}{dy}\right|$$ where $\left| \frac{dx}{dy}\right|$ is the abolute of the Jacobian determinant, and $f_X(x)$ and $f_Y(y)$ are the PDFs of $X$ and $Y$, respectively. Note: This formula is valid, if the transformation is invertible.

Now calc:

• $\left| \frac{dy}{dx}\right| = y \Rightarrow \left| \frac{dx}{dy}\right| =\left| \frac{1}{\frac{dy}{dx}} \right| = \frac{1}{y}$
• $f_Y(y) = f_x(x) \; \left| \frac{dx}{dy}\right| = \varphi(x) \; \frac{1}{y} = \varphi(\ln{(y)}) \; \frac{1}{y}$, where $f_x(x) = \varphi(x) = \frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}}$. As it should, this yields the same solution as Stefans wrote.
• Could you expand little bit more on why the absolute value goes away? – Joseph Garvin Jun 10 '18 at 21:01
• The question states $Y = e^X$. Hence, there are no negativ values. – Semoi Jun 22 '18 at 19:34