obtaining expected value for moment generating function

579 Views Asked by At

This is the given cumulative distribution function:

$F(x) = \begin{cases} 0 & x<0\\ 0.5x & 0≤x<1 \\ 0.25(x-1) + 0.5 & 1≤x<3\\ 1 & y≥3 \end{cases}$

We are asked to determine E($X$), E($X^2$), Var($X$), the mgf of X, and also use the mgf to verify the values of E($X$) and E($X^2$).

I got the following density function from the cdf:

F(x) = \begin{cases} 0 & x<0\\ 0.5 & 0≤x<1 \\ 0.25 & 1≤x<3\\ 0 & y≥3 \end{cases}

My working was:

E($X$)= $\int_0^10.5x\;dx$ + $\int_1^30.25x\;dx$ = $1.25$

E($X^2$)= $\int_0^10.5x^2\;dx$ + $\int_1^30.25x^2\;dx$ = $\frac56$

Mgf = $\int_0^10.5e^{tx}\;dx$ + $\int_1^30.25e^{tx}\;dx$ = $\frac{e^{t}}{4t}+\frac{e^{3t}}{4t}-\frac{1}{2t}$

This seemed a valid cdf, and if so, my questions are: (i) I get a negative value for the variance, so I am not sure if I am calculating E($X$) and E($X^2$) correctly; (ii) the mgf does not seem correct (is it possible to have 't' in the denominator, for example the first derivative of $\frac{1}{2t}$ would be -$\frac{1}{2t^2}$ which would be undefined when we substitute 0 for t).

1

There are 1 best solutions below

5
On BEST ANSWER

For the first question, see my comment. For your second question, mgf is correct, notice that your calculation only works for $t\neq 0$, for $t=0$ we have $E(e^{tX}) = E(1) = 1$. This will always be the case, mgf equals to $1$ for $t=0$. You can also see this by taking limit as $t\to 0$ from your function.

$$\lim_{t\to 0} (\frac{e^t-1}{2t}+\frac{e^t(e^{2t}-1)}{4t}) = 1/2+1/2 = 1 $$

$$\lim_{t\to 0} \frac{E(e^{tX})-E(e^0)}{t} = \lim_{t\to 0} (E(e^{tX}))' = \lim_{t\to 0} (\frac{e^t}{4t}-\frac{e^t}{4t^2}+\frac{3e^{3t}}{4t}-\frac{e^{3t}}{4t^2}+\frac{1}{2t^2}) = 1.25$$

Direct calculations aren't very efficient, but you can do it like this.

$$\frac{e^t-1}{2t}+\frac{e^t(e^{2t}-1)}{4t} = \frac{1}{2}(\sum_{n=0}^\infty \frac{t^n}{(n+1)!} +\sum_{n=0}^\infty \frac{t^n}{n!} \sum_{n=0}^\infty \frac{(2t)^n}{(n+1)!}) = \frac{1}{2}(\sum_{n=0}^\infty \frac{t^n}{(n+1)!} +\sum_{n=0}^\infty t^n \sum_{k=0}^n \frac{2^k}{(n-k)!(k+1)!}) $$

$$\sum_{k=0}^n\frac{2^k}{(n-k)!(k+1)!} = \frac{1}{(n+1)!}\sum_{k=0}^n\binom{n+1}{k+1}2^k = \frac{1}{2(n+1)!}(3^{n+1}-1) $$

So the series becomes $$\sum_{n=0}^\infty t^n\frac{1}{4(n+1)!}(3^{n+1}+1)$$

$$E(X^n) = \frac{1}{4(n+1)}(3^{n+1}+1) $$

$$ E(X)=\frac{1}{8}(3^2+1) = 1.25,\,E(X^2) = \frac{1}{12}(3^3+1) = \frac{7}{3} $$