伽瑪分布

機率統計

教學錄影

數學符號

數學基礎

排列組合

機率統計簡介

機率

機率公理

隨機變數

連續測度

單一分布

條件機率

聯合分布

貝氏定理

動差生成函數

特徵函數

機率法則匯總

離散分布

二項分布

多項分布

負二項分布

幾何分布

超幾何分布

布瓦松分布

連續分布

均勻分布

常態分布

Gamma 分布

指數分布

卡方分布

柯西分布

Weibull 分布

T 分布

F 分布

Beta 分布

多維分布

統計

抽樣

敘述統計

推論統計

中央極限定理

估計方法

單組樣本估計

兩組樣本估計

檢定方法

單組樣本檢定

兩組樣本檢定

平均値的推論

變異數的推論

無母數推論

迴歸分析

變異數分析

實驗設計

因子實驗

品質管制

時間序列

數據分類

統計定理匯總

統計情況分類

計算統計

蒙地卡羅法

最大似然法則

假說與學習

EM 算法

簡單貝氏分類

貝氏網路

隨機過程

馬可夫鏈

蒙地卡羅馬可夫

資源

範例

投影片

教學錄影

練習題

考題解答

訊息

相關網站

參考文獻

最新修改

簡體版

English

伽瑪分布 (Gamma distribution)

  • 課本寫法:
(1)
\begin{align} f(x) = \frac{1}{\Gamma(\alpha) \beta^{\alpha}} x^{\alpha-1} e^{-x/\beta} \end{align}
  • R 的寫法:
(2)
\begin{align} gamma(shape=a, rate=s) = \frac{1}{\Gamma(a) s^a } x^{a-1} e^{-x/s} \end{align}
  • Gamma 函數的定義
(3)
\begin{align} \Gamma(k) = \int_{0}^{\infty} z^{k-1} e^{-z} dz \end{align}

特性

(4)
\begin{eqnarray} 1. && E(X) = \alpha \beta \\ 2. && Var(X) = \alpha \beta^2 \end{eqnarray}

動差生成函數

(5)
\begin{align} m_x(t) = (1-\beta t)^{-\alpha} \end{align}

R 程式範例一

op=par(mfrow=c(2,2))
curve(dgamma(x, 1,1), 0, 10)
curve(dgamma(x, 1,5), 0, 10)
curve(dgamma(x, 5,1), 0, 10)
curve(dgamma(x, 5,5), 0, 10)
dgammaCurve4.jpg

R 程式範例二

-log(dgamma(1:4, shape=1))
p <- (1:9)/10
pgamma(qgamma(p,shape=2), shape=2)
1 - 1/exp(qgamma(p, shape=1))

# even for shape = 0.001 about half the mass is on numbers
# that cannot be represented accurately (and most of those as zero)
pgamma(.Machine$double.xmin, 0.001)
pgamma(5e-324, 0.001)  # on most machines 5e-324 is the smallest
                       # representable non-zero number
table(rgamma(1e4, 0.001) == 0)/1e4

執行結果:

> -log(dgamma(1:4, shape=1))
[1] 1 2 3 4
> p <- (1:9)/10
> pgamma(qgamma(p,shape=2), shape=2)
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
> 1 - 1/exp(qgamma(p, shape=1))
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
> 
> # even for shape = 0.001 about half the mass is on numbers
> # that cannot be represented accurately (and most of those as zero)
> pgamma(.Machine$double.xmin, 0.001)
[1] 0.4927171
> pgamma(5e-324, 0.001)  # on most machines 5e-324 is the smallest
[1] 0.4752741
>                        # representable non-zero number
> table(rgamma(1e4, 0.001) == 0)/1e4

 FALSE   TRUE 
0.5188 0.4812 
>

參考文獻

  1. Wikipedia:伽瑪分布
  2. Wikipedia:http://en.wikipedia.org/wiki/Gamma_distribution

Facebook

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License