Statistics & probability

Moment-generating function calculator

Evaluate a known distribution’s MGF and inspect its logarithm, domain, mean and second moment.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Try it, understand it

Explore the result

Compare an evaluation at zero with two specified probability models. The moments shown are always derivatives at zero.

Worked example comparison
ExampleOutputWhat to notice
Poisson at t = 0Moment-generating function M(t)1M(0) is 1, regardless of the Poisson expected count. Here the mean and variance remain 3.
Poisson at t = 0.2Moment-generating function M(t)1.9429516278For λ = 3, log M(t) = 3(exp(0.2) − 1). M(t) exceeds one because it is not a probability.
Four trials at t = log 2Moment-generating function M(t)5.0625With n = 4 and p = 0.5, M(t) = (0.5 + 0.5 × 2)⁴ = 5.0625.

Check your understanding

Before checking: should every MGF value lie between zero and one?

No. It averages exp(tX), not an event indicator. The binomial example gives 5.0625.

Can I evaluate an exponential MGF at t equal to its rate?

Not as a finite MGF. The domain is strictly t < λ; the calculator rejects the boundary and values beyond it.

Behind the numbers

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.

THE FORMULAM(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.

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.

Find your calculator

Start typing to explore the library.