How this calculation works
Choose a supported distribution and its parameters, or supply a finite probability mass function. The MGF is evaluated with logarithmic formulas where useful. Its derivatives at zero identify the mean and raw second moment. They are not derivatives at the evaluation argument.
M(t) = E[exp(tX)]; M′(0) = E[X]; M″(0) = E[X²]A worked example
For a Poisson count with λ = 3 and t = 0.2, log M(t) = 3(exp(0.2) − 1), and M(t) is approximately 1.943.
Good to know
Selected distribution formulas and finite PMFs only; no arbitrary-density integration or symbolic distribution inference. t is bounded to ±100. Exponential MGFs require t < rate. Finite support has at most 1,000 entries within ±1 trillion. Large or tiny M(t) values are labeled outside numeric range while log M(t) remains available. The MGF is not a probability.
Reference: Penn State: moment-generating functions (opens in a new tab) ↗
An exponential expectation packages information about a distribution
The moment-generating function averages exp(tX) over a probability model. It is a function of the argument t, rather than a probability that X lies in a region. Its value can exceed one without violating any probability rule. At t = 0, every exponential term is one and the expectation is one.
For the Poisson distribution with expected count λ, log M(t) = λ(exp(t) − 1). Differentiating at zero gives mean λ and second raw moment λ + λ². Variance subtracts the squared mean from that raw second moment, leaving λ.
For independent sums, moment-generating functions multiply where the required expectations are finite. Their logarithms therefore add. Independence is essential: the product rule cannot be assumed merely because two variables have known marginal distributions.
The domain and parameter convention matter
An exponential waiting time with rate λ has mean 1/λ and M(t) = λ/(λ − t), only for t < λ. The expression must not be evaluated outside that domain and treated as an expectation. A negative algebraic fraction beyond the boundary is not a valid MGF value.
A supplied finite probability mass function requires one probability for every listed support value. Repeated support values are allowed because their contributions simply add. Zero-probability entries contribute nothing; probabilities must still sum to one within the stated tolerance.
Large positive arguments can make M(t) exceed the finite numeric range, while very negative log values can make direct exponentiation underflow. The logarithm remains useful and is reported separately. This is evaluation of known models, not symbolic integration of an arbitrary density or proof that an unknown distribution has an MGF near zero.
A few questions, answered
Are the displayed moments derivatives at my chosen t?
No. The mean and second raw moment are derivatives at zero. The input t only selects the evaluation point for M(t).
Can an MGF exceed 100%?
It is not a percentage or probability. For instance, a constant positive X has M(t) = exp(tX), which exceeds one for positive t.
Does every distribution have an MGF near zero?
No. Some distributions have finite moments without a finite MGF on an open interval around zero. This tool only offers models with the displayed domain.