0

We have the following cumulative distribution function:

$$ F(x) = \begin{cases} 0 & x < 0 \\ x^2/9 & 0 \le x \le 3 \\ 1 & x > 3 \end{cases} $$

To find $X$ in terms of $U \sim \mathrm{Uniform}[0, 1]$:

$$ F^{-1}(u)=\min\{x: F(x) \ge u\}=\min\{x: x^2/9 \ge u\}=\min\{x: x \ge 3 \sqrt{u}\}=3\sqrt{u}$$

$$X =F^{-1}(U)=3\sqrt{U}$$

However suppose now that:

$$ F(x) = \begin{cases} 0 & x < 1 \\ x^2/9 & 1 \le x \le 3 \\ 1 & x > 3 \end{cases} $$

Following the same steps as above, we would have:

$$ X =F^{-1}(U)=3\sqrt{U}$$

This doesn't seem right since the steps don't seem to take into the account the different range of values for $x$. I'd like to know what the correct approach is.

user137481
  • 2,605

1 Answers1

1

That is not correct.

Your second distribution has two parts: a discrete part with $$ P(X=1) = F(1) - \lim_{x\to1^-} F(x) = 1/9 - 0 =\frac19 $$ and a continuous part with $$ P(X>1) = 1 - P(X \le 1) = 1 - P(X = 1) = \frac89. $$

The continuous part is uniform on $(1,3)$ only given $X>1$, so that $$ P\big(X<x\big|X>1\big) = \frac{P(1<X<x)}{P(X>1)}\mathbb1(x>1) = \frac{F(x)-F(1)}{1-F(1)}\mathbb1(x>1) = \frac{x^2/9-1/9}{8/9}\mathbb1(1<x<3) = \frac{x^2-1}{8}\mathbb1(1<x<3). $$

To actually generate a variate from that second distribution, you would have to consider $$ X = \max\{1, 3\sqrt{U}\} = \begin{cases} 1, &\text{if $U<1/9$}\\ F^{-1}(U) = 3\sqrt{U}, &\text{if $U>1/9$.} \end{cases} $$