0

Let $X$ be the random variable with pdf $\frac{1}{2\theta}e^{-|x|/\theta}$ with $\theta>0$. I want to find its moment generating function. I think I’ve found it but when I try to use it to find the second moment something must have gone wrong. I calculate it as:

$$\int_{-\infty}^\infty e^{-tx}\frac{1}{2\theta}e^{-|x|/\theta} = \frac{1}{2\theta}\left( \int_{-\infty}^0 e^{-tx+x/\theta}dx+ \int_0^\infty e^{-tx-x/\theta}dx \right)$$

$$ = \frac{1}{2\theta}\left( \left[ \frac{ e^{ x(1/\theta-t) } }{1/\theta-t}\right]_{-\infty}^0 + \left[ \frac{ e^{ -x(1/\theta+t) } }{-(1/\theta+t)}\right]_0^\infty \right) $$

$$ = \frac{1}{2\theta}\left(\frac{1}{1/\theta-t}-\frac{1}{1/\theta+t}(0-1)\right) $$

$$ = \frac{1}{2}\left(\frac{1}{1-t\theta}+\frac{1}{1+t\theta}\right) $$

I justify that this all works out if $t$ is chosen in an interval about 0 no larger in radius than $1/\theta$. Now Evaluating at $t=0$ tells me the expectation of $X$ is 1, sounds good. But if I compute the derivative to find the second moment,

$$M_X’(t)=\frac{1}{2}\left(-\frac{1}{(1-t\theta)^2}(-\theta)-\frac{1}{1+t\theta)^2}(\theta)\right) $$

$$ = \frac{1}{2}\left(\frac{\theta}{(1-t\theta)^2}-\frac{\theta}{(1+t\theta)^2}\right)$$

Evaluated with $t=0$ this gives that $E[X^2]=0$ which cannot be correct. Yet the MGF seemed valid in a domain around 0, and infinitely differentiable in that domain, no?

Addem
  • 5,656
  • @heropup it looks as if the major difference in my calculations and those calculations is that, I took $e^{x(1/\theta-t)}\rightarrow 0$ as $x\rightarrow -\infty$. This step seems to eliminate the exponential from the MGF whereas in their solutions there is an exponential function. But I’m not seeing why my move is invalid. – Addem Dec 12 '20 at 04:26
  • Actually I don’t think that’s a difference any more since for my problem $\mu=0$ so that would wipe out the exponential. – Addem Dec 12 '20 at 04:29
  • So as far as I can tell I computed the MGF accurately. – Addem Dec 12 '20 at 04:30
  • Oh, now I’m seeing the issue. Because I mistook the MGF at 0 to be the expectation, then what I’ve really shown is that the expectation is 0 which actually makes more sense. And then I’d compute a second derivative to get the second moment. – Addem Dec 12 '20 at 04:32

1 Answers1

1

Although I posted a comment referring you to another answer, it is worth pointing out that $M_X'(0) = \operatorname{E}[X]$, not $\operatorname{E}[X^2]$. The general formula is $$\operatorname{E}[X^k] = \left[ \frac{d^k M_X}{dt^k} \right]_{t=0}.$$ This means that we must always have $M_X(0) = 1$ whenever $M_X$ is defined in a neighborhood of $0$, since $X^0 = 1$.

heropup
  • 135,869