If $X\sim U(0,1)$ then $Y=-\frac{1}{\lambda }\ln(1-X)\sim Exp(\lambda )$

760 Views Asked by At

If $X\sim U(0,1)$ then $Y=-\frac{1}{\lambda }\ln(1-X)\sim Exp(\lambda )$

Here is my solution : If $X\sim U(0,1)$ then $f(x)=1$ where $0\leq x\leq 1$.

$0<x\Rightarrow -x\leq 0\Rightarrow 1-x\leq 1\Rightarrow \ln (1-x)\leq 0\Rightarrow 0<-\frac{1}{\lambda }\ln (1-x)\Rightarrow y>0$

$F(y)=P(Y\leq y)=P(-\frac{1}{\lambda }\ln (1-X)\leq y)=P(X\leq 1-e^{-\lambda y})=\int_{0}^{1-e^{-\lambda y}}dx=1-e^{-\lambda y}$

From here,

$$\begin{cases} f(y)=\frac{dF(y)}{dy}=\lambda e^{-\lambda y}& \text{ if } y>0 \\ 0& \text{otherwise } \end{cases}$$

But I am confused the interval of uniform distribution. Should I take the interval $0<x<1$ or $0\leq x\leq 1$? If I take $0\leq x\leq 1$ then $y\geq 0$ but from definiton y can not be $0$ when $f(y)=\lambda e^{-\lambda y}$. Any help will be appreciated.

2

There are 2 best solutions below

4
On BEST ANSWER

Note that the density of an absolutely continuous random variable is only defined up to almost-everywhere equivalence. In particular, if you redefine the value of the density in a finite number of points, it will still be a density of the same random variable / distribution. Accordingly, $f = 1_{(0,1)}$ and $f = 1_{[0,1]}$ both do the job for $X \sim U(0,1)$. It makes sense to choose $f = 1_{(0,1)}$ here though, as the transformation $g(x):= -\frac{1}{\lambda}\ln(1-x)$ only takes finite values on $(0,1)$. Again, what value you choose at $y = 0$ for the resulting density does not matter.

0
On

This 'inverse CDF' (or quantile) transformation is often used in simulation. (Pseudo) random number generators in many statistical software programs give values $U$ that are very difficult to distinguish from a random sample from $\mathsf{Unif}(0,1).$

Then $Y = -\frac{1}{\lambda}\log_e(1-U) \sim \mathsf{Exp}(\mathrm{rate}=\lambda).$

In practice, if $U\sim\mathsf{Unif}(0,1),$ then $$U^\prime = 1 - U \sim \mathsf{Unif}(0,1)$$ also, so the transformation is simplified to $Y = -\frac{1}{\lambda}\log_e(U).$

Demonstration (in R) for $\lambda = 0.5$ and $n = 5000$ observations randomly sampled from $\mathsf{Exp}(\lambda=.5).$

set.seed(2021)
u = runif(5000)
y = -2*log(u)
summary(y);  length(y);  sd(y)

     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
 0.000006  0.576511  1.413981  2.010671  2.820853 17.580193 
[1] 5000       # sample size
[1] 1.978818   # sample SD, aprx 2.

hdr = "n = 5000: Simulated Sample from EXP(rate=0.5)"
hist(y, prob=T, br = 30, ylim=c(0,.5), col="skyblue2", main=hdr)
curve(dexp(x, .5), add=T, lwd=2, col="orange", n = 10001)

enter image description here