0

As shown here:

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

However, the answer below this has the PDF as: \begin{cases} \dfrac{1}{(b - a) \cdot x}, & a \leq -\ln(x) \leq b \\ 0, & \text{else} \end{cases}

which does not match the earlier answer.

I know the first answer is the answer I have seen elsewhere. Can anyone explain what the second answer is saying and reconcile with the first one?

The comments after the second answer discuss

$$X \sim U(0,1) \text{ versus} X \sim U(a,b)$$

but even if I substitute $a=0, b=1$ in the second answer, I cannot reduce to a $Y=\text{Exp}(1)$ random variable PDF.

From what I can see the second answer is wrong, because it does not result in a $Exp(1)$. In fact, it uses the PDF method to derive the PDF of $Y=-\ln X$, and uses $Y=-\ln X$ rather than the inverse, which is the usual case in the formula.

Starlight
  • 2,684
  • Do the comments after the second answer help in any way? – Fabian Feb 21 '25 at 06:29
  • 1
    You should start proving that $X\sim U(0,1)$ if and only if $Y=-\log(1-X)\sim {\rm Exp}(1),.$ This is easy when you use the CDF of $Y$ which is $F(y)=1-e^{-y},.$ Then use something $U(a,b)$ cannot do, namely that $1-X$ is $U(0,1)$ if and only if $X$ is $U(0,1),.$ I think this distinguishes that log-uniform distribution from the exponential distribution. – Kurt G. Feb 21 '25 at 10:23
  • @kurtG from my calculations, the second answer is wrong. But I don't know for sure, and that's why I asked the question. – Starlight Feb 21 '25 at 10:30
  • Because the second answer should be the same distribution as the first (so long as it is answering the OP's question). – Starlight Feb 21 '25 at 10:31

1 Answers1

1

The other post is hard to follow but I think it is correct.

Like in the other post we assume and define $$ X\sim U(a,b)\,,\quad (a,b)\subset [0,+\infty)\,,\quad Y:=-\ln X\,. $$ The CDF of this $Y$ is \begin{align*} F_Y(y)&=\mathbb P\big\{-\ln X\le y\big\}=1-\mathbb P\big\{\ln X< -y\big\}\\[2mm] &=1-\mathbb P\big\{X< e^{-y}\big\}=\cases{1\,,& if $e^{-y}\le a\,,$\\[2mm] 1-\frac{ e^{-y}-a}{b-a}\,,& if $a<e^{-y}<b\,,$\\[2mm] 0\,, & if $b\le e^{-y}\,.$} \end{align*} The last equals sign follows simply from $X\sim U(a,b)\,.$ Differentiating yields the PDF of $Y\,:$

$$ f_Y(y)=\frac d{dy}F_Y(y)=\cases{ 0\,,& if $e^{-y}\le a\,,$\\[2mm] \frac{ e^{-y}}{b-a}\,,& if $a<e^{-y}<b\,,$\\[2mm] 0\,, & if $b\le e^{-y}\,.$} $$ Sanity check: when $a=0,b=1$ these are the well known CDF and PDF of the exponential distribution with $\lambda =1\,.$

To compare this with the other answer we make the transformation $y=\ln x$ and get $$ f_Y(\ln x)=\cases{ 0\,,& if $\frac1x\le a\,,$\\[2mm] \frac{1}{(b-a)\,x}\,,& if $a<\frac1x<b\,,$\\[2mm] 0\,, & if $b\le \frac1x\,.$} $$ The three cases splitting the domain can be written as $$ \frac1a\le x\,,\qquad \frac1b<x<\frac1a\,,\quad x\le \frac1b\,. $$ I totally admit that in this format setting $a=0,b=1$ it is impossible to see that this ever was an exponential distribution but it is one. Only written in strange variables.

Kurt G.
  • 17,136
  • I understood what you did in deriving the CDF and PDF (which is the standard method). What is (or could be )the purpose of the transformation $y=\ln x$? – Starlight Feb 21 '25 at 12:29
  • @Starlight I am glad that I learned something new and did not have to take "to court" someone who wrote an answer with 9 upvotes nine years ago. Purpose? Who knows. It links two distributions. Let's move on. – Kurt G. Feb 21 '25 at 12:33