Spot the mistake when computing the density function of $Y = 1/X$ when the density function of $X$ is known.

57 Views Asked by At

The random variable $X$ has density function $f_{X}$ given by

\begin{equation} f_{X}(x) = \begin{cases} \frac{1}{2} \ \ \ \ \ x \in (0,1] \\ \frac{1}{2x^2} \ \ x \in (1,\infty) \\ 0 \ \ \ \ \ \ x \in (-\infty,0] \end{cases} \end{equation} Let $F_{X}$ be the distribution function of $X$. The random variable $Y$ is defined as follows $Y = 1/X$. I want to compute the density function of $Y$.

Here's my attempt:

Let $y \in \mathbb{R}$ and let $F_{Y}(y)$ be the distribution function of $Y$.

\begin{equation} F_{Y}(y) = P(Y\leq y) = P(1/X \leq y) = P(1/y \leq X) = P(X \geq 1/y) \end{equation}

case 1: if $y \in (0,1) \implies 1/y \in (1,\infty) $. Then

\begin{equation} F_{Y}(y) = P(X \geq 1/y) = 1 - P(X < 1/y) = 1 - F_{X}(1/y) = 1- \int_{1}^{1/y} \frac{1}{2x^2} dx = \frac{1+y}{2} \end{equation}

case 2: if $y \in [1,\infty) \implies 1/y \in (0,1) $. Then

\begin{equation} F_{Y}(y) = P(X \geq 1/y) = 1 - P(X < 1/y) = 1 - F_{X}(1/y) = 1- \int_{0}^{1/y} \frac{1}{2} dx =1-\frac{1}{2y} \end{equation}

case 3: if $y \in (-\infty,0) \implies 1/y \in (-\infty,0) $. Then

\begin{equation} F_{Y}(y) = P(X \geq 1/y) = 1 - P(X < 1/y) = 1 - F_{X}(1/y) = 1- \int_{\infty}^{1/y} 0 dx =1 \end{equation}

\begin{equation} F_{Y}(y) = \begin{cases} 1, \ \ \ \ \ \ \ \ \ \ y \in (-\infty,0) \\ \frac{1+y}{2}, \ \ \ \ \ \ \ y \in (0,1) \\ 1-\frac{1}{2y}, \ \ \ \ y \in [1,\infty) \end{cases} \end{equation}

But the function $F_{Y}(y)$ is not non-decreasing, hence is not a distribution. If $F_{Y}$ were a distribution then it would be easy to compute $f_{Y}$

\begin{equation} f_{Y}(y) = \begin{cases} 0, \ \ \ \ \ \ \ \ \ y \in (-\infty,0) \\ \frac{1}{2}, \ \ \ \ \ \ \ y \in (0,1) \\ \frac{1}{2y^{2}}, \ \ \ \ y \in [1,\infty) \end{cases} \end{equation}

questions:

  1. Do you know where I made a mistake?
  2. Do you know another strategy to compute $f_{Y}$?

Thanks in advance.

3

There are 3 best solutions below

0
On BEST ANSWER

In case 1, it should be

$$P(X \ge 1/y) = \int_{1/y}^\infty \frac{1}{2x^2} \, dx$$ or alternatively $$P(X \ge 1/y) = 1 - P(X < 1/y) = 1 - \left(\int_0^1 \frac{1}{2} \, dx + \int_1^{1/y} \frac{1}{2x^2} \, dx\right).$$

You make a similar mistake in case 2.

0
On

A simpler approach is possible via the formula $$f_Y(y) = f_X(g^{-1}(y)) \left|\frac{dg^{-1}}{dy}\right|,$$ where $Y = g(X) = 1/X$, since $g$ is an injective function. Then since the density of $X$ may be more compactly written as $$f_X(x) = \frac{1}{2 \max(1, x^2)} \mathbb 1 (x > 0)$$ then for $g^{-1}(y) = 1/y$ we immediately have $$f_Y(y) = \frac{1}{2 \max(1, 1/y^2)} \mathbb 1 (1/y > 0) \cdot \frac{1}{y^2} = \frac{\min(1, y^2)}{2 y^2} \mathbb 1 (0 < y < \infty) = \frac{\min(1/y^2, 1)}{2} \mathbb 1 (0 < y < \infty)$$ which in piecewise form is $$f_Y(y) = \begin{cases} 0, & y < 0 \\ \frac{1}{2}, & 0 \le y \le 1 \\ \frac{1}{2y^2}, & 1 < y < \infty .\end{cases}$$

This shows that $1/X$ has the same distribution as $X$ itself, which makes sense since the conditional distribution $X \mid 0 < X < 1$, and $1/X \mid X > 1$, are both the same uniform distribution.

0
On

Do you know where I made a mistake?

Deciding that $\mathsf P(Y\leq y)=\mathsf P(X\geq 1/y)$ for all $y$ reguardless of location on the number line.

Do you know another strategy to compute $f_Y$?

You're method is okay, but since you are only interested in the pdf, save some thought and assert it as being the unsigned derivative of $F_X(1/y)$.

You do not need to know the value of the CDF at any point, just its gradient.

$$\begin{align}f_Y(y)&=\left\lvert \dfrac{\mathrm d F_X(1/y)}{\mathrm d y}\right\rvert\\[3ex] f_{X}(x) &= \begin{cases} 0 && x \in (-\infty,0]\\{1}/{2} && x \in (0,1] \\ {1}/{2x^2} && x \in (1,\infty) \end{cases}\\[2ex]F_X(x)&=\begin{cases}0 && x\in(-\infty,0]\\x/2&&x\in(0,1]\\1- 1/2x&&x\in (1,\infty)\end{cases}\\[2ex]F_X(1/y)&=\begin{cases}0 && 1/y\in(-\infty,0]\\1/2y&&1/y\in(0,1]\\1- y/2&&1/y\in (1,\infty)\end{cases}\\[2ex] f_Y(y)&=\begin{cases}0 &&y\in(-\infty,0]\\1/2y^2&&y\in[1,\infty)\\1/2&& y\in(0,1)\end{cases}\end{align}$$


PS: even more effort may be saved by recognising $\left\lvert\dfrac{\mathrm d F_X(1/y)}{\mathrm d y}\right\rvert=\left\lvert \dfrac{\mathrm d (1/y)}{\mathrm d y}\right\rvert~f_Y(1/y)$ so no integration need be performed at all.

$$f_Y(y) =\dfrac{1}{\lvert 2y^2\rvert} \begin{cases} 0 && 1/y \in (-\infty,0]\\{1}/{2} && 1/y \in (0,1] \\ {y^2}/{2} && 1/y \in (1,\infty) \end{cases}$$