# 伽玛分布

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

## 機率密度函數

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

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

${\displaystyle {\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

${\displaystyle 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 }}$

${\displaystyle K_{x}\left(t\right)=\ln M_{x}\left(t\right)=\alpha \left[\ln \lambda -\ln \left(\lambda -t\right)\right]}$

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

${\displaystyle {\frac {d^{2}K_{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的加成性

${\displaystyle \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)}$