# 伽玛分布

參數 概率密度函數 累積分佈函數 $k > 0\,$ shape (real) $\theta > 0\,$ scale (real) $x \in [0; \infty)\!$ $x^{k-1} \frac{\exp{\left(-x/\theta\right)}}{\Gamma(k)\,\theta^k}\,\!$ $\frac{\gamma(k, x/\theta)}{\Gamma(k)}\,\!$ $k \theta\,\!$ no simple closed form $(k-1) \theta\,\!$ for $k \geq 1\,\!$ $k \theta^2\,\!$ $\frac{2}{\sqrt{k}}\,\!$ $\frac{6}{k}\,\!$ $k + \ln\theta + \ln\Gamma(k) \!$ $+ (1-k)\psi(k) \!$ $(1 - \theta\,t)^{-k}\,\!$ for $t < 1/\theta\,\!$ $(1 - \theta\,i\,t)^{-k}\,\!$

## 機率密度函數

$X \sim \Gamma(\alpha, \beta)$；且令$\lambda = \frac{1}{\beta}$： （即$X \sim \Gamma(\alpha, \frac{1}{\lambda})$）。

$f \left( x \right) = \frac{x^\left(\alpha-1\right)\lambda^\alpha e^\left(-\lambda x\right)}{\Gamma\left(\alpha \right)}$x > 0

$\begin{cases} \Gamma(\alpha)=(\alpha-1)! & \mbox{if }\alpha\mbox{ is }\mathbb{Z}^+ \\ \Gamma(\alpha)=(\alpha-1)\Gamma(\alpha-1)& \mbox{if }\alpha\mbox{ is }\mathbb{R}^+ \\ \Gamma \left( \frac{1}{2} \right) = \sqrt{\pi} \end{cases}$

## 動差生成函數、概率母函数、期望值、方差

Gamma分配的動差生成函數 m.g.f

$M_{x}\left( t \right) = E\left( e^{xt} \right) = \frac{\lambda^\alpha}{\Gamma\left(\alpha\right)} \int_{0}^{\infty} e^{xt}x^{\alpha-1}e^{-\lambda x} dx = \left( \frac{\lambda}{\lambda-t} \right)^{\alpha}$

$K_x\left(t\right) = \ln M_x\left( t \right) = \alpha\left[\ln\lambda-\ln\left(\lambda-t\right)\right]$

$\frac { dK_x \left( t \right) } {dt} = \frac {\alpha} {\lambda-t} ,\quad when(t=0), E\left( X \right) = \frac{\alpha}{\lambda}$

$\frac { d^2K_x \left( t \right) } {dt^2} = \frac {\alpha} {\left(\lambda-t\right)^2} ,\quad when(t=0), \sigma^2\left( X \right) = \frac{\alpha}{\lambda^2}$

## Gamma的加成性

$\coprod \begin{cases} r.v.X\sim \Gamma \left( \alpha_1,{\color{Red}\lambda} \right) \\ r.v.Y\sim \Gamma \left( \alpha_2,{\color{Red}\lambda} \right) \end{cases} \Longrightarrow X+Y\sim \Gamma \left( {\color{red}\alpha_1+\alpha_2},\lambda \right)$