Skip to content

MomentGeneratingFunction ​

The moment generating function M(t)=E[etX]M(t) = E[e^{tX}] of distdist.

MomentGeneratingFunction(dist, t)a per-distribution closed form, the same scoped subset CharacteristicFunction covers, minus CauchyDistribution (its MGF genuinely does not exist — E[etX]E[e^{tX}] diverges for any t≠0t\neq0) and plus LogisticDistribution via the Beta function.
Typed signatures
TypePackageApplies
(distribution, complex) -> complexstatisticsalways

Domain: Statistics

Details
  • M(t)=φ(t/i)M(t) = \varphi(t/i) in principle; this file writes each distribution's formula directly (the naive i -> 1 substitution of CharacteristicFunction's formula) rather than deriving one from the other, EXCEPT LogisticDistribution, whose MGF is eμtB(1−βt,1+βt)e^{\mu t}B(1-\beta t, 1+\beta t) — a different (still elementary) closed form from its CF.
  • M(0)=1M(0) = 1 always; a numeric derivative of MM at t=0t=0 reproduces Mean (checked in tests/distributions-3.test.ts, not repeated here).

Examples

Basic #
live ↗
InMomentGeneratingFunction(GammaDistribution(2,1),t)\mathrm{MomentGeneratingFunction}(\mathrm{GammaDistribution}(2, 1), t)Out1(1−t)2\frac{1}{(1-t)^2}
live ↗
InMomentGeneratingFunction(PoissonDistribution⁡(2),0)\mathrm{MomentGeneratingFunction}(\operatorname{PoissonDistribution}(2), 0)Out11
Possible issues #
live ↗
InMomentGeneratingFunction(CauchyDistribution(0,1),1)\mathrm{MomentGeneratingFunction}(\mathrm{CauchyDistribution}(0, 1), 1)OutMomentGeneratingFunction(CauchyDistribution(0,1),1)\mathrm{MomentGeneratingFunction}(\mathrm{CauchyDistribution}(0, 1), 1)
About
Examples3

See also: CharacteristicFunction, PDF, Moment, Cumulant