What Is the MGF of X − Y?
At a glance
- 1. Start with the definition
Write the MGF of the difference as E[e^{t(X−Y)}].
- 2. Check independence
If X and Y are independent, factor the expectation into separate MGFs.
- 3. Reverse the sign
The Y factor is M_Y(−t), not M_Y(t).
- 4. Check the domain
Use only t values where both required MGFs are finite.
- 5. Handle dependence jointly
Without independence, evaluate E[e^{t(X−Y)}] from the joint distribution.
The moment-generating function (MGF) of a random variable is , for values of where the expectation is finite. To find the MGF of a difference, the key step is to keep track of the minus sign on .
If and are independent, then
The formula is valid on the range of where both factors on the right are finite. If and are dependent, this product rule does not generally apply; use the joint distribution to calculate .
Deriving the formula
Start from the definition and rewrite the exponential:
When and are independent, functions of and are independent as well. Therefore the expectation factors:
The argument of is because the exponent contains . This is the main detail that distinguishes the MGF of a difference from the MGF of a sum. For independent variables, the sum formula is ; for a difference, replace the second with .
Worked example: independent exponential variables
Suppose and are independent exponential random variables with rates and . An exponential variable with rate has MGF
Thus for , while
The condition is equivalent to . Combining the two domain conditions gives . Consequently,
For example, if both rates are , then
This MGF is symmetric in , so its first derivative at zero is zero. That matches . Its second derivative at zero is , which is the variance of : independence gives .
If X and Y are dependent
Without independence, the correct starting point remains
but you cannot usually split this into a product of marginal expectations. If has a joint density , for instance, use
provided the integral is finite. A joint probability mass function gives the analogous sum. Dependence matters because knowing the separate distributions of and does not, in general, tell you the distribution of their difference.
For example, if , then with probability one, so . Multiplying by would generally give a different answer: that product treats the variables as independent, not identical copies that are equal on every outcome.
Common mistakes
- Using instead of . The negative argument follows directly from .
- Multiplying MGFs without independence. The factorization is justified by independence, not merely by knowing both marginal MGFs.
- Ignoring the domain. In the independent case, must belong to the domain of and also make finite. The example’s domain is the intersection .
- Confusing a difference with a ratio. The MGF concerns ; it does not directly give the distribution or MGF of .
Once the MGF is known near zero, derivatives can provide moments when they exist. In particular, for independent variables with finite means and variances, and .
References
- A First Course in Probability — Sheldon Ross
- Statistical Inference — George Casella and Roger L. Berger
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.