## 動差生成函數 (下)

1. 機率密度函數 (probability density function) $f(x)$ 滿足 $P(a\le X\le b)=\int_{a}^bf(x)dx$
2. 累積分布函數 $F(x)$ 代表 $P(X\le x)=\int_{-\infty}^xf(z)dz$

\displaystyle\begin{aligned} \mu&=E(X)=\int_{-\infty}^{\infty}xf(x)dx\\ \sigma^2&=E(X-\mu)^2=\int_{-\infty}^{\infty}(x-\mu)^2f(x)dx.\end{aligned}

$\displaystyle \mu_k=E\left(X^k\right)=\int_{-\infty}^{\infty}x^kf(x)dx$

$\displaystyle m(t)=E\left(e^{Xt}\right)=E\left(\sum_{k=0}^{\infty}\frac{X^kt^k}{k!}\right)=\sum_{k=0}^{\infty}\frac{\mu_kt^k}{k!}=\int_{-\infty}^{\infty}e^{xt}f(x)dx$

$\displaystyle m^{(k)}(t)=\int_{-\infty}^\infty x^ke^{xt}f(x)dx=E\left(X^ke^{Xt}\right)$

$\displaystyle m(t)=\sum_{k=0}^\infty\frac{\mu_kt^k}{k!}$

$\displaystyle \mu_k=\int_{-\delta}^{\delta}x^kf(x)dx$

$\displaystyle \vert\mu_k\vert\le\int_{-\delta}^{\delta}\vert x^k\vert f(x)dx\le \delta^k\int_{-\delta}^{\delta}f(x)dx=\delta^k$

$\displaystyle \sum_{k=0}^r\left|\frac{\mu_kt^k}{k!}\right|\le\sum_{k=0}^r\frac{\vert\delta t\vert^k}{k!}\le \sum_{k=0}^\infty\frac{\vert\delta t\vert^k}{k!}=e^{\vert \delta t\vert}$

$\displaystyle \psi(\tau)=m(-2\pi i\tau)=\int_{-\infty}^{\infty}e^{-2\pi ix\tau}f(x)dx$

$\displaystyle f(x)=\int_{-\infty}^{\infty}e^{2\pi ix\tau}\psi(\tau)d\tau$

$\displaystyle m(t)=\int_0^\infty e^{xt}\lambda e^{-\lambda x}dx=\int_0^\infty\lambda e^{(t-\lambda)x}dx=\left.\frac{\lambda e^{(t-\lambda)x}}{t-\lambda}\right|_0^\infty=\frac{\lambda}{\lambda-t}$

$\displaystyle \mu_k=m^{(k)}(0)=\left.\frac{\lambda k!}{(\lambda-t)^{k+1}}\right|_{t=0}=\frac{k!}{\lambda^k}$

\displaystyle\begin{aligned} \mu_k&=\int_{0}^{\infty}x^k\lambda e^{-\lambda x}dx=\lambda(-1)^k\frac{d^k}{d\lambda^k}\int_{0}^{\infty}e^{-\lambda x}dx\\ &=\lambda(-1)^k\frac{d^k}{d\lambda^k}\lambda^{-1}=\frac{k!}{\lambda^k},\end{aligned}

$\displaystyle m(t)=\sum_{k=0}^\infty \frac{\mu_kt^k}{k!}=\sum_{k=0}^\infty\left(\frac{t}{\lambda}\right)^k=\frac{\lambda}{\lambda-t}$

$\displaystyle f(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}$

\displaystyle\begin{aligned} m(t)&=E\left(e^{Xt}\right)=\int_{-\infty}^\infty e^{xt}\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx\\ &=e^{t^2/2}\int_{-\infty}^\infty\frac{1}{\sqrt{2\pi}}e^{-(x-t)^2/2}dx=e^{t^2/2} .\end{aligned}

$\displaystyle \mu_k=E\left(X^k\right)=\int_{-\infty}^{\infty}x^k\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}x^{k-1}\left(xe^{-x^2/2}\right)dx$

$k$ 是奇數時，由機率密度函數的對稱性可知上式等於零。以下考慮 $k$ 是偶數的情形。使用部分積分技巧，令 $u=x^{k-1}$$dv=xe^{-x^2/2}dx$，即有 $du=(k-1)x^{k-2}$$v=-e^{-x^2/2}$。所以動差為

\displaystyle\begin{aligned} E\left(X^k\right)&=\frac{1}{\sqrt{2\pi}}\left(\left.-x^{k-1}e^{-x^2/2}\right|_{-\infty}^{\infty}+(k-1)\int_{-\infty}^{\infty}x^{k-2}e^{-x^2/2}dx\right)\\ &=\frac{k-1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}x^{k-2}e^{-x^2/2}dx=(k-1)E\left(X^{k-2}\right) .\end{aligned}

\displaystyle\begin{aligned} E\left(X^k\right)&=(k-1)(k-3)\cdots 3\cdot 1\\ &=\frac{k!}{\prod_{j=1}^{k/2}2j}=\frac{k!}{2^{k/2}(k/2)!}.\end{aligned}

$\displaystyle \mu_k=\left\{\begin{matrix} 0& k\hbox{~odd}\\ 2^{-k/2}\frac{k!}{(k/2)!} & k\hbox{~even.} \end{matrix}\right.$

$\displaystyle f(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$

$\displaystyle m_Y(t)=e^{\mu t}m_X(\sigma t)=e^{\mu t}e^{(\sigma t)^2/2}=e^{\mu t+\sigma^2t^2/2}$

\displaystyle\begin{aligned} m_Y(t)&=e^{\mu t+\sigma^2t^2/2}=1+\left(\mu t+\frac{1}{2}\sigma^2t^2\right)+\frac{1}{2}\left(\mu t+\frac{1}{2}\sigma^2t^2\right)^2+\cdots\\ &=1+\mu t+\frac{1}{2}\left(\sigma^2+\mu^2\right)t^2+\cdots ,\end{aligned}

\displaystyle\begin{aligned} m_Z(t)&=m_{X}(t)m_{Y}(t)=e^{\mu_1 t+\sigma_1^2t^2/2}e^{\mu_2 t+\sigma_2^2t^2/2}\\ &=e^{(\mu_1+\mu_2)t+(\sigma_1^2+\sigma_2^2)t^2/2}.\end{aligned}

$\displaystyle\lim_{n\to\infty}\frac{\sqrt{n}(\overline{X}_n-\mu)}{\sigma}\sim N(0,1)$

$\displaystyle m_{S_n}(t)=\prod_{i=1}^nm_{X_i}(t)=\left(m(t)\right)^n$

$\displaystyle m_{\overline{X}_n}(t)=m_{S_n/n}(t)=m_{S_n}\left(\frac{t}{n}\right)=\left(m\left(\frac{t}{n}\right)\right)^n$

$\displaystyle Z_n=\frac{\sqrt{n}(\overline{X}_n-\mu)}{\sigma}=\frac{\sqrt{n}}{\sigma}\overline{X}_n-\frac{\sqrt{n}\mu}{\sigma}$

$\displaystyle m_{Z_n}(t)=e^{-\sqrt{n}\mu t/\sigma}m_{\overline{X}_n}\left(\frac{\sqrt{n}t}{\sigma}\right)=e^{-\sqrt{n}\mu t/\sigma}\left(m\left(\frac{t}{\sigma\sqrt{n}}\right)\right)^n$

$v=t/(\sigma\sqrt{n})$。計算自然對數，

\displaystyle\begin{aligned} \log\left(m_{Z_n}(t)\right)&=-\frac{\sqrt{n}\mu t}{\sigma}+n\log\left(m\left(\frac{t}{\sigma\sqrt{n}}\right)\right)\\ &=-\frac{\mu t^2}{\sigma^2 v}+\frac{t^2}{\sigma^2 v^2}\log\left(m(v)\right)\\ &=\left(\frac{t^2}{\sigma^2}\right)\frac{\log(m(v))-\mu v}{v^2}. \end{aligned}

$n$ 趨於無窮大時，使用二次 l’Hôpital 法則以及 $m(0)=1$，可得

\displaystyle\begin{aligned} \lim_{n\to\infty}\log(m_{Z_n}(t))&=\frac{t^2}{\sigma^2}\lim_{v\to 0}\frac{\log(m(v))-\mu v}{v^2}\\ &=\frac{t^2}{\sigma^2}\lim_{v\to 0}\frac{(m(v))^{-1}m'(v)-\mu}{2v}\\ &=\frac{t^2}{\sigma^2}\lim_{v\to 0}\frac{(m(v))^{-2}\left(m''(v)m(v)-(m'(v))^2\right)}{2}\\ &=\frac{t^2}{\sigma^2}\frac{m''(0)-(m'(0))^2}{2}\\ &=\frac{t^2}{\sigma^2}\frac{\mu_2-\mu^2_1}{2}=\frac{t^2}{2}.\end{aligned}

$\displaystyle \lim_{n\to\infty} m_{Z_n}(t)=e^{t^2/2}$

$n\to\infty$，上式說明 $Z_n=\frac{\sqrt{n}(\overline{X}_n-\mu)}{\sigma}\sim N(0,1)$

$\displaystyle \psi(t)=E(e^{iXt})=\int_{-\infty}^{\infty}e^{ixt}f(x)dx$

$\displaystyle \vert \psi(t)\vert\le\int_{-\infty}^{\infty}\vert e^{ixt}\vert f(x)dx=\int_{-\infty}^{\infty}f(x)dx=\psi(0)=1$

[1] 維基百科：Moment generating function
[2] 維基百科：Characteristic function (probability theory)

### 2 Responses to 動差生成函數 (下)

1. 張盛東 說道：

老師，其實特徵函數是否可以完全替代動差生成函數？

• ccjou 說道：

可以的，動差生成函數未必收斂，但特徵函數一定收斂。我感覺比較艱深的概率學課本採用特徵函數 (可能因為涉及傅立葉轉換)，比較簡易的概率學則使用動差生成函數。另外離散隨機變數有時候用機率母函數 (probability generating function) 較容易分析，即 $G(z)=E(z^X)=\sum_{x=0}^\infty p(x)z^x$。甚至在queueing theory會用pdf的Laplace變換，即 $L(s)=E(e^{-sX})=\int_{0}^\infty f(x)e^{-sx}dx$