From a Distribution to Its MGF
An MGF turns a probability model into a function of a real parameter \(t\). To construct it directly, use the distribution of \(X\): add a term for each possible value when \(X\) is discrete, or integrate across the support when \(X\) has a density. The support and the probabilities or density values determine the calculation.
The same definition applies in either case. The main practical challenge is translating the model accurately into a sum or integral, then identifying the values of \(t\) for which the result is finite. These steps are useful before using an MGF for any later calculation.
Writing the Sum or Integral
For a discrete random variable, let \(p_X(x)=P(X=x)\) denote its probability mass function. Each possible value \(x\) contributes \(e^{tx}\) multiplied by its probability. For a continuous random variable with density \(f_X(x)\), the corresponding contribution is integrated over the support. In either case, include every possible value or the entire support, respectively.
These formulas come directly from the definition of expectation. For a discrete variable, the expectation of a function \(g(X)\) is the sum of \(g(x)\) times the probability of \(x\). Substituting \(g(x)=e^{tx}\) gives the sum formula. For a continuous variable, the expectation is the integral of \(g(x)\) times the density; the same substitution gives the integral formula.
For a finite discrete support, every term in the sum is finite for every real \(t\), so the MGF is finite for all real \(t\). For a continuous distribution, whether the integral is finite can depend on \(t\). A bounded support ensures finiteness for every real \(t\), while an unbounded support requires checking the behavior of the integrand as \(x\) grows. In every model, \(M_X(0)=1\) when the distribution is properly normalized.
Worked Example: A Finite PMF With a Negative Value
A hypothetical discrete risk indicator \(X\), measured in index units, has the PMF \(P(X=-1)=1/4\), \(P(X=0)=1/2\), and \(P(X=2)=1/4\). Construct its MGF and evaluate it at \(t=\ln 2\). State the domain on which it is finite.
Method. Use the discrete expectation formula, pairing each possible value with its probability. First check the probabilities: \(1/4+1/2+1/4=1\), so they form a valid PMF.
Substitute \(t=\ln 2\). Then \(e^{-t}=e^{-\ln 2}=1/2\), \(e^{0t}=1\), and \(e^{2t}=e^{2\ln 2}=4\). Therefore,
Because the support has only three values, every term is finite for all real \(t\); thus the MGF is finite on the whole real line. As a check, setting \(t=0\) gives \(1/4+1/2+1/4=1\). The negative support value contributes \(e^{-t}\), not \(e^t\). Reversing that sign is a common error when a support point is negative.
Integrating a Density Over Its Support
For a continuous model, the density is not itself a probability at a point. Instead, \(f_X(x)\,dx\) represents probability in a small interval near \(x\), and the MGF accumulates the weighted contributions \(e^{tx}f_X(x)\,dx\) over the support. The limits of integration must match where the density is positive.
Worked Example: A Bounded Triangular Density
A hypothetical continuous score \(X\), in score units, has density \(f_X(x)=x/2\) for \(0<x<2\), and density zero elsewhere. Construct the MGF and evaluate it at \(t=1\). Determine its domain.
Method. Integrate \(e^{tx}f_X(x)\) over \(0<x<2\). First verify the density is normalized:
For \(t\ne 0\), integration by parts gives an antiderivative for \(xe^{tx}\) of \(e^{tx}(x/t-1/t^2)\). Applying the limits and multiplying by \(1/2\),
At \(t=1\), this becomes
The integral is finite for every real \(t\) because \(X\) is confined to the bounded interval \((0,2)\). The displayed algebraic expression is stated for \(t\ne0\), but the defining integral applies at \(t=0\) and gives \(M_X(0)=1\). The apparent division by zero in the formula at \(t=0\) is a limitation of that algebraic form, not a failure of the MGF to exist. The calculation avoids the mistake of integrating over all real numbers instead of the density’s actual support.
Checking the Domain on an Unbounded Support
When the support extends without bound, the exponential factor \(e^{tx}\) can either increase or decrease as \(x\) grows. The density also affects the integrand, so the finiteness condition must be checked using the full product \(e^{tx}f_X(x)\), not by looking at \(e^{tx}\) alone.
Worked Example: An Exponential Density and Its Finite Range
A hypothetical waiting time \(X\), measured in years, has an exponential distribution with rate \(\lambda=3\) per year. Thus \(f_X(x)=3e^{-3x}\) for \(x\ge 0\), and zero otherwise. Construct the MGF, find exactly where it is finite, and evaluate it at \(t=1\) per year.
Method. Insert the stated rate and density into the continuous expectation formula:
This improper integral converges only if \(3-t>0\), or \(t<3\). In that case, integrating and evaluating the endpoint limit gives
If \(t=3\), the integrand is the constant \(3\), whose integral over \([0,\infty)\) diverges. If \(t>3\), the integrand increases exponentially and the integral also diverges. Therefore the exact finite domain is \(t<3\), which includes an open interval around zero.
At \(t=1\), the rate and the argument use the same time unit, so
As a check, \(M_X(0)=3/3=1\). The common domain error is to include \(t=3\) because the formula has a denominator there; the original integral shows that it diverges at that boundary.
A Reliable Construction Process
A disciplined setup reduces errors in both discrete and continuous problems. In particular, write the distribution and support before manipulating exponentials. This makes it easier to catch a missing probability, an incorrect integration limit, or a domain restriction.
List the possible values and probabilities for a discrete variable, or state the density and the interval where it is positive for a continuous variable.
Use a weighted sum for a PMF or integrate \(e^{tx}f_X(x)\) over the full support for a density.
For an improper integral, check its limiting behavior before reporting a formula or domain.
Set \(t=0\) in the defining sum or integral and confirm that the result is \(1\).
Common Mistakes and Why the Construction Matters
- Leaving out a probability weight. In a PMF calculation, the term is \(e^{tx}P(X=x)\), not just \(e^{tx}\). Every support value must be weighted by its probability.
- Using the wrong support. A density that is positive only on a bounded interval must be integrated over that interval, even if an antiderivative is defined more broadly.
- Assuming every real \(t\) works. Finite support guarantees this for a discrete variable, but an unbounded continuous support can produce a restricted domain.
- Treating a simplified formula as valid at every \(t\). Algebraic expressions can have removable singularities, as in the triangular-density example, or genuine divergences, as at the exponential boundary. Return to the defining sum or integral to distinguish them.
Constructing an MGF from the model is a direct way to check that the distribution, support, and probability weights have been interpreted correctly. It also makes the domain explicit, which matters whenever the defining expectation is not finite for every \(t\). The central habit is simple: start from \(E[e^{tX}]\), use the appropriate expectation formula, and verify the result at \(t=0\).
The procedures here are aligned with the SOA VEE Mathematical Statistics syllabus. They apply to finite-support PMFs and continuous densities without requiring a memorized MGF formula.
Check Your Understanding
For each problem, construct the MGF directly from the stated distribution and use its support to check the requested value or domain.
- A discrete variable \(X\) takes values \(0,1,3\) with probabilities \(0.2,0.5,0.3\), respectively. Find \(M_X(t)\) and evaluate \(M_X(\ln 2)\). (Answer: \(M_X(t)=0.2+0.5e^t+0.3e^{3t}\); \(M_X(\ln 2)=3.6\).)
- A discrete variable \(X\) takes values \(-2\) and \(1\) with probabilities \(0.4\) and \(0.6\). Find its MGF and evaluate it at \(t=\ln 2\). (Answer: \(M_X(t)=0.4e^{-2t}+0.6e^t\); \(M_X(\ln 2)=1.3\).)
- A continuous variable has density \(f_X(x)=1/3\) for \(1<x<4\), and zero elsewhere. Find its MGF for \(t\ne0\), state its domain, and give \(M_X(0)\). (Answer: \(M_X(t)=(e^{4t}-e^t)/(3t)\) for \(t\ne0\); finite for all real \(t\); \(M_X(0)=1\).)
- A waiting time \(X\), in years, has an exponential density with rate \(5\) per year. Find the domain of its MGF and evaluate it at \(t=2\) per year. (Answer: \(M_X(t)=5/(5-t)\) for \(t<5\); \(M_X(2)=5/3\).)
- A discrete variable takes values \(0,2,5\) with probabilities \(0.2,0.5,0.3\). Construct its MGF and evaluate it at \(t=\ln(1/2)\). (Answer: \(M_X(t)=0.2+0.5e^{2t}+0.3e^{5t}\); \(M_X(\ln(1/2))=107/320=0.334375\).)