11

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.

Stefan Hansen
  • 25,582
  • 7
  • 59
  • 91
Sandrochka
  • 121
  • 1
  • 1
  • 4

4 Answers4

12

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$.

André Nicolas
  • 507,029
2

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$.

Stefan Hansen
  • 25,582
  • 7
  • 59
  • 91
1

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.
Semoi
  • 527
1

As other answers already covered the probability density function, I want to answer parts 2 and 3 of the question: Namely the mean and variance of $E(e^X)$:

For the meant we see that the following calculation holds: \begin{equation*} E(e^X)=\int_{-\infty}^\infty e^{x}\frac{1}{\sqrt{2\pi}}\cdot e^{x^2/2}dx=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty exp\left(-\frac{x(x-2)}{2}\right) dx \end{equation*} Now make the substitution $t=x+1$ to obtain: \begin{equation*} E(e^X)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \exp\left(-\frac{t^2-1}{2}\right)dt=e^{1/2} \end{equation*} Now we shall calculate $E(Y^2)=E(e^{2X})$: \begin{align*} E(e^{2X})=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \exp\left(-\frac{x(x-4)}{2}\right)dx\overset{t=x+2}{=}\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \exp\left(-\frac{t^2-4}{2}\right)dt=e^2 \end{align*} In the end we hence obtain: \begin{align*} Var(e^X)=E(e^{2x})-(E(e^X))^2=e^2-e=e(e-1). \end{align*}