[Math] the moment generating function given a density of a continuous random variable

probability

Let $X$ be a continuous random variable with a density
$$f_X(x) = \begin{cases}e^{-(x-1)}& \text{for }x > 1\\ 0 & \text{otherwise}\end{cases}$$
How do I compute the moment generating function of X? What is the range on which the moment generating function is defined?

How do I used the moment generating function to compute the mean, the second moment and the variance of X?

Best Answer

As noted above (and standard anyway) $M(t)=E(e^{tx})=\int_1^{oo} e^{tx}e^{-(x-1)} dx$. Note that if t=1 the integrand becomes simply e^1, and the integral does not exist. So M(1) is undefined. Also note that if $t>1$ the integrand is $e^{(t-1)x+1}>e^{(t-1)x}$ which since $t>1$ goes to infinity as $x$ does. So M(t) does not exist for t>1.

We claim now that M(t) exists for t<1. The antiderivative of the integrand is $\frac {e^{-x(1-t)}e^1}{t-1}$, which goes to $0$ as $x$ approaches infinity, and evaluates to $\frac {e^t}{t-1}$ at $x=1$. We thus have the formula

$M(t)=\frac {e^t}{1-t}$

for the moment generating function, on the domain $\{t:t<1\}$. Note that this domain includes an open neighborhood of 0, so that moment generating calculations of moments can be done as usual.

To get the mean, second moment, and variance we only need a few terms of the series for $M(t)$. We can get these by multiplying the series for $e^t$ by the series for $1/(1-t)$. That is,

$(1+t+t^2/2+t^3/6+...)(1+t+t^2+t^3+...)$

which gives first few terms $M(t)=1+2t+(5/2)t^2+(8/3)t^3+...$. Then the usual procedure of taking derivatives and putting in zero gives $E(X)=2$ and $E(X^2)=5$. Finally, using the standard formula for variance we get $V(X)=E(X^2)-[E(X)]^2=5-2^2=1$.