|
| 1 | +--- |
| 2 | +title: Moment Generating Functions |
| 3 | +date: 2025-11-11/13 |
| 4 | +--- |
| 5 | + |
| 6 | +## Moments and generating functions for sequences |
| 7 | + |
| 8 | +Let $X$ be a random variable. For $n \ge 1$, the **$n$-th moment** of $X$ is |
| 9 | +$$ |
| 10 | +\mathbb{E}(X^n). |
| 11 | +$$ |
| 12 | + |
| 13 | +For a (deterministic) sequence $\{a_n\}_{n\ge 0}$, the **(ordinary) generating function** is |
| 14 | +$$ |
| 15 | +F(z) = \sum_{n=0}^{\infty} a_n z^n. |
| 16 | +$$ |
| 17 | +Within the radius of convergence, |
| 18 | +$$ |
| 19 | +a_n = \frac{1}{n!} \frac{d^n}{dz^n} F(z)\bigg|_{z=0}. |
| 20 | +$$ |
| 21 | + |
| 22 | +The **exponential generating function** is |
| 23 | +$$ |
| 24 | +G(z) = \sum_{n=0}^{\infty} \frac{a_n}{n!} z^n, |
| 25 | +$$ |
| 26 | +and then |
| 27 | +$$ |
| 28 | +a_n = \frac{d^n}{dz^n} G(z)\bigg|_{z=0}. |
| 29 | +$$ |
| 30 | + |
| 31 | +For random variables, the moment generating function plays a similar role with coefficients given by the moments $\mathbb{E}(X^n)$. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Moment generating function: definition and basic properties |
| 36 | + |
| 37 | +### Definition |
| 38 | + |
| 39 | +For a real-valued random variable $X$, the **moment generating function (mgf)** is |
| 40 | +$$ |
| 41 | +M_X(t) = \mathbb{E}\big(e^{tX}\big), \qquad t \in \mathbb{R}, |
| 42 | +$$ |
| 43 | +whenever this expectation is finite. |
| 44 | + |
| 45 | +Using the power series of the exponential, |
| 46 | +$$ |
| 47 | +e^{tX} = \sum_{n=0}^{\infty} \frac{(tX)^n}{n!}, |
| 48 | +$$ |
| 49 | +we obtain |
| 50 | +$$ |
| 51 | +M_X(t) = \mathbb{E}\left(\sum_{n=0}^{\infty} \frac{(tX)^n}{n!}\right) |
| 52 | += \sum_{n=0}^{\infty} \frac{t^n}{n!} \mathbb{E}(X^n), |
| 53 | +$$ |
| 54 | +where the interchange of expectation and summation is justified when the series converges absolutely. |
| 55 | + |
| 56 | +In particular, |
| 57 | +$$ |
| 58 | +\mathbb{E}(X^n) = \frac{d^n}{dt^n} M_X(t)\bigg|_{t=0}. |
| 59 | +$$ |
| 60 | + |
| 61 | +### Basic properties |
| 62 | + |
| 63 | +- $M_X(0) = \mathbb{E}(e^{0\cdot X}) = 1$. |
| 64 | +- **Uniqueness (informal):** if $M_X(t)$ exists in a neighborhood of $0$ and two random variables $X,Y$ have the same mgf on such an interval, then $X$ and $Y$ have the same distribution. |
| 65 | +- **Independence and sums:** |
| 66 | + If $X$ and $Y$ are independent and $Z = X+Y$, then |
| 67 | + $$ |
| 68 | + M_Z(t) = \mathbb{E}\big(e^{t(X+Y)}\big) |
| 69 | + = \mathbb{E}\big(e^{tX} e^{tY}\big) |
| 70 | + = \mathbb{E}(e^{tX}) \, \mathbb{E}(e^{tY}) |
| 71 | + = M_X(t) M_Y(t). |
| 72 | + $$ |
| 73 | + More generally, for independent $X_1,\dots,X_n$, |
| 74 | + $$ |
| 75 | + M_{X_1+\cdots+X_n}(t) = \prod_{k=1}^n M_{X_k}(t). |
| 76 | + $$ |
| 77 | +- **Domain issues:** |
| 78 | + It can happen that $M_X(t)$ is finite only for $t$ in some interval around $0$, or even that |
| 79 | + $$ |
| 80 | + M_X(t) = \infty \quad \text{for all } t \ne 0. |
| 81 | + $$ |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Examples of mgfs |
| 86 | + |
| 87 | +> **Example (Exponential distribution).** |
| 88 | +> Let $X \sim \mathrm{Exp}(\lambda)$ with density $\lambda e^{-\lambda x}$ on $[0,\infty)$. |
| 89 | +> Then for $t \in \mathbb{R}$, |
| 90 | +> $$ |
| 91 | +> M_X(t) = \int_0^{\infty} \lambda e^{-\lambda x} e^{tx} \, dx |
| 92 | +> = \lambda \int_0^{\infty} e^{-(\lambda - t)x} \, dx. |
| 93 | +> $$ |
| 94 | +> If $t < \lambda$, the integral converges: |
| 95 | +> $$ |
| 96 | +> M_X(t) = \lambda \cdot \frac{1}{\lambda - t} = \frac{\lambda}{\lambda - t}. |
| 97 | +> $$ |
| 98 | +> If $t \ge \lambda$, the integral diverges and $M_X(t) = \infty$. |
| 99 | +> Hence |
| 100 | +> $$ |
| 101 | +> M_X(t) = |
| 102 | +> \begin{cases} |
| 103 | +> \dfrac{\lambda}{\lambda - t}, & t < \lambda,\\[4pt] |
| 104 | +> \infty, & t \ge \lambda. |
| 105 | +> \end{cases} |
| 106 | +> $$ |
| 107 | +
|
| 108 | +> **Example (Binomial distribution).** |
| 109 | +> Let $X \sim \mathrm{Bin}(n,p)$. Then |
| 110 | +> $$ |
| 111 | +> M_X(t) |
| 112 | +> = \mathbb{E}(e^{tX}) |
| 113 | +> = \sum_{k=0}^{n} e^{tk} \binom{n}{k} p^k (1-p)^{n-k}. |
| 114 | +> $$ |
| 115 | +> Factor: |
| 116 | +> $$ |
| 117 | +> M_X(t) = \sum_{k=0}^{n} \binom{n}{k} (p e^t)^k (1-p)^{n-k} |
| 118 | +> = (1 - p + p e^t)^n. |
| 119 | +> $$ |
| 120 | +> Differentiate: |
| 121 | +> $$ |
| 122 | +> M_X'(t) = n(1 - p + p e^t)^{n-1} \cdot p e^t, |
| 123 | +> $$ |
| 124 | +> $$ |
| 125 | +> M_X''(t) |
| 126 | +> = n(n-1)(1 - p + p e^t)^{n-2} (p e^t)^2 |
| 127 | +> + n(1 - p + p e^t)^{n-1} p e^t. |
| 128 | +> $$ |
| 129 | +> At $t=0$, |
| 130 | +> $$ |
| 131 | +> \mathbb{E}(X) = M_X'(0) |
| 132 | +> = n(1 - p + p)^{n-1} p |
| 133 | +> = np, |
| 134 | +> $$ |
| 135 | +> $$ |
| 136 | +> \mathbb{E}(X^2) = M_X''(0) |
| 137 | +> = n(n-1)p^2 + np. |
| 138 | +> $$ |
| 139 | +> Hence |
| 140 | +> $$ |
| 141 | +> \operatorname{Var}(X) |
| 142 | +> = \mathbb{E}(X^2) - (\mathbb{E}X)^2 |
| 143 | +> = np(1-p). |
| 144 | +> $$ |
| 145 | +
|
| 146 | +> **Example (Poisson distribution).** |
| 147 | +> Let $X \sim \mathrm{Poi}(\lambda)$. Then |
| 148 | +> $$ |
| 149 | +> M_X(t) = \mathbb{E}(e^{tX}) |
| 150 | +> = \sum_{k=0}^{\infty} e^{tk} e^{-\lambda} \frac{\lambda^k}{k!} |
| 151 | +> = e^{-\lambda} \sum_{k=0}^{\infty} \frac{(\lambda e^t)^k}{k!} |
| 152 | +> = e^{-\lambda} e^{\lambda e^t} |
| 153 | +> = \exp\big(\lambda(e^t - 1)\big). |
| 154 | +> $$ |
| 155 | +> From this, |
| 156 | +> $$ |
| 157 | +> \mathbb{E}X = \lambda, \qquad \operatorname{Var}(X) = \lambda. |
| 158 | +> $$ |
| 159 | +
|
| 160 | +> **Example (Uniform distribution on $[a,b]$).** |
| 161 | +> Let $X \sim \mathrm{Unif}([a,b])$. Then |
| 162 | +> $$ |
| 163 | +> M_X(t) = \mathbb{E}(e^{tX}) |
| 164 | +> = \int_a^b \frac{1}{b-a} e^{tx} \, dx |
| 165 | +> = \frac{e^{tb} - e^{ta}}{t(b-a)}, \quad t \ne 0, |
| 166 | +> $$ |
| 167 | +> and $M_X(0)=1$ by continuity. |
| 168 | +> Differentiating and letting $t\to 0$ recovers |
| 169 | +> $$ |
| 170 | +> \mathbb{E}X = \frac{a+b}{2}, \qquad |
| 171 | +> \operatorname{Var}(X) = \frac{(b-a)^2}{12}. |
| 172 | +> $$ |
| 173 | +
|
| 174 | +> **Example (Normal distribution).** |
| 175 | +> Let $X \sim N(\mu,\sigma^2)$. Then |
| 176 | +> $$ |
| 177 | +> M_X(t) |
| 178 | +> = \mathbb{E}(e^{tX}) |
| 179 | +> = \frac{1}{\sqrt{2\pi}\sigma} \int_{-\infty}^{\infty} |
| 180 | +> \exp\left(-\frac{(x-\mu)^2}{2\sigma^2} + tx\right) \, dx. |
| 181 | +> $$ |
| 182 | +> Completing the square in the exponent yields |
| 183 | +> $$ |
| 184 | +> M_X(t) = \exp\left(\mu t + \frac{1}{2}\sigma^2 t^2\right). |
| 185 | +> $$ |
| 186 | +> In particular, |
| 187 | +> $$ |
| 188 | +> \mathbb{E}X = \mu, \qquad \operatorname{Var}(X) = \sigma^2. |
| 189 | +> $$ |
| 190 | +> If $X \sim N(\mu_1,\sigma_1^2)$ and $Y \sim N(\mu_2,\sigma_2^2)$ are independent, then |
| 191 | +> $$ |
| 192 | +> M_{X+Y}(t) = M_X(t) M_Y(t) |
| 193 | +> = \exp\left( (\mu_1 + \mu_2)t + \frac{1}{2}(\sigma_1^2 + \sigma_2^2)t^2 \right), |
| 194 | +> $$ |
| 195 | +> so |
| 196 | +> $$ |
| 197 | +> X+Y \sim N(\mu_1+\mu_2, \sigma_1^2 + \sigma_2^2). |
| 198 | +> $$ |
| 199 | +
|
| 200 | +--- |
| 201 | + |
| 202 | +## Characteristic functions |
| 203 | + |
| 204 | +Because $M_X(t)$ can be infinite for all $t\ne 0$, it is often more convenient to use the **characteristic function** |
| 205 | +$$ |
| 206 | +\varphi_X(t) = \mathbb{E}(e^{itX}), \qquad t \in \mathbb{R}. |
| 207 | +$$ |
| 208 | + |
| 209 | +- Always satisfies $|\varphi_X(t)| \le 1$. |
| 210 | +- If $X,Y$ are independent and $Z=X+Y$, then |
| 211 | + $$ |
| 212 | + \varphi_Z(t) = \varphi_X(t)\,\varphi_Y(t). |
| 213 | + $$ |
| 214 | +- For $X\sim N(\mu,\sigma^2)$, |
| 215 | + $$ |
| 216 | + \varphi_X(t) = \exp\big(i\mu t - \tfrac{1}{2}\sigma^2 t^2\big). |
| 217 | + $$ |
| 218 | + |
| 219 | +When they exist in a neighborhood of $0$, both the mgf and characteristic function uniquely determine the distribution of $X$. |
0 commit comments