Random variable transformation formula not working

41 Views Asked by At

Let there be a probability density function

$$f(x) = \frac{1}{4}\quad x\in(0,4)$$ $$f(x) = 0\quad \text{elsewhere}$$

Its distribution function therefore is $$ F_x(x)=\frac{x}{4} \quad x\in(0,4) $$

$$ F_x(x)=0 \quad x<0 $$

$$ F_x(x)=1 \quad x>4 $$

The task is to find the distribution function of a transformed variable $$Y=-\ln(X)$$

Here are my steps: $$F_Y(y) = P(Y\le y) = P(-\ln(X) \le y) = P(\ln(X) \ge -y)=\\ P(X\ge e^{-y}) = 1-P(X\leq e^{-y}) = 1-F_X(e^{-y}) =\\ 1-\frac{e^{-y}}{4}$$

From this follows that the density function of the transformed variable is $$f_Y(y)=(1-\frac{e^{-y}}{4})' = \frac{e^{-y}}{4}$$

However, there is a rule that states that the following is true:

$$f_Y(y) = f_X(h^{-1}(y))\cdot (h^{-1}(y))'$$

This does not hold for me though, because upon plugging in my values, this is my result:

$$f_Y(y)=\frac{1}{4}\cdot (e^{-y})' = \frac{1}{4}\cdot (-e^{-y}) = -\frac{e^{-y}}{4}$$

The result is different from the one I obtained by differentiation. What happened?