[Math] Moment generating function of mixed distribution

moment-generating-functionsprobability distributions

Suppose we have a mixed distribution
$$F(x)=\begin{cases}
0, x<0 \\
0.2+0.3x, x\in[0,2) \\
1, x\ge2
\end{cases}
$$
Which means $$P(X=0)=0.2, P(X=2)=0.2$$
and
$$f(x)=0.3, x\in[0,2)$$
If I want to calculate the expected value, I calculate $E(X)$ for the discrete and continuous probabilities and add them
$$E(X)=0*0.2+2*0.2=0.4$$ $$E(X)=\int_0^2 \! 0.3x \, \mathrm{d}x=0.6 $$ $$E(X)=0.4+0.6=1$$
And now my question. I want to get the moment generating function for this mixed distribution. Can I also make the MGF for discrete and continuous probabilities and later add them like I've done with $E(X)$?

Best Answer

The MGF is given by $$M_X(t) = {\rm E}[e^{tX}],$$ wherever it is convergent. So if $\Pr[X = 0] = \Pr[X = 2] = \frac{1}{5}$, then we have $$\begin{align*} {\rm E}[e^{tX}] &= e^{t \cdot 0}\Pr[X = 0] + e^{t \cdot 2} \Pr[X = 2] + \int_{x=0}^2 e^{tx} \cdot \frac{3}{10} \, dx \\ &= \frac{1}{5}\left(1 + e^{2t}\right) + \frac{3}{10t}(e^{2t} - 1). \end{align*}$$

Related Question