1
$\begingroup$

I would like to compute (and plot) the exact density of the following distribution:

$ X_i \sim exp(-Exponential(\lambda)) - 0.5 $

I already have the estimated density for this distribution, but I need to get its exact density to compute the MSE of my kernel estimator.

I have difficulties to transform the function to be able to plot its density.

For now, I have tried to compute it (with r). I used the inverse of the transformation to be able to compute the pdf using dexp().

X2 <- exp(-rexp(n,rate =1))-0.5 #get random sample
X2<-sort(X) 
plot(X2,dexp(-log(X2+0.5))) 

But this gives me results that are not coherent with my estimated density. comparison of true vs estimated

What am I doing wrong here?

$\endgroup$
  • 2
    $\begingroup$ Welcome to CV nahaut. To see what goes wrong, write $\text{Pr}[X \leq x ]$ as a probability involving the exponentilal r.v. say $E$ then use the known distribution of $E$. $\endgroup$ – Yves Jan 5 at 15:54
  • $\begingroup$ Thanks. I don't understand exactly what you meant. I tried to calculate the density using the transformation method but it's not giving me the correct results. $\endgroup$ – nahaut Jan 5 at 19:20
  • $\begingroup$ I considered that $ -ln(X_i + 0.5) \sim Exponential(\lambda)$. Then, I considered that it was a function of the random variable: $U= -ln(X_i + 0.5)$. After computation, the result I got was not giving the adequate density: $fu(U)= e^{-e^{-u}+0.5-u}$ $\endgroup$ – nahaut Jan 5 at 19:27
  • 2
    $\begingroup$ Note that $X$ has its values in $I:=(-0.5, \, 0.5)$. For $x \in I$, we have $\text{Pr}\{X \leq x \} = \text{Pr}\{U \geq - \log(x + 0.5) \} = \exp[\lambda \log(x + 0.5)]$ since $\text{Pr}\{U \geq u \} = \exp[-\lambda u]$ for $u > 0$. So $\text{Pr}\{X \leq x \} = [ x + 0.5]^\lambda$ and the density comes by derivation. Please use the appropriate tag homework̀ or self-study. $\endgroup$ – Yves Jan 6 at 8:15
  • 1
    $\begingroup$ Look for the keyword Jacobian to understand your mistake. $\endgroup$ – Xi'an Jan 6 at 21:25

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.