💡 學習重點:離散機率的定義
■ Binomial[n, p]
: 重複發生機率為p
的實驗n
次,其發生次數的分佈
■ Geomtric[p]
: 重複發生機率為p
的實驗,第一次發生前失敗次數的分佈
■ NBinomial[n, p]
: 重複發生機率為p
的實驗,第n
次發生前失敗次數的分佈
■ Poisson[
\(\lambda\)]
: 期望值為\(\lambda\)的小機率事件發生次數的分佈
資料 HorseKick
:每一個軍團、每年被馬踢死的人數
nDeaths
0 1 2 3 4
109 65 22 3 1
檢定:這一份數據符合Poisson分佈嗎?
Goodness-of-fit test for poisson distribution
X^2 df P(> X^2)
Likelihood Ratio 0.86822 3 0.83309
p=0.833
:數據與Poisson沒有顯著差異
係數:What is the \(\lambda\)?
$lambda
[1] 0.61
應用:nDeath >= 2
的機率是?
[1] 0.12521
🧙 問題討論:
如果保險公司想要為國防部設計一個被馬踢死的保險:
■ 如果你只要只靠HorseKick
這一份數據,每一軍團每年被馬踢死的次數超過5次的機率是多?
■ 如果我們將數據fit到理論分布上面,根據理論分佈,被馬踢死的次數超過5次的機率是多?
■ 妳想要計算風險成本的話,以上哪一種做法比較合理呢?
What is the probability of nDeath >= 5
?
資料 Federalist
:某份聯邦文件中,每一個段落出現“may”這個字的次數
nMay
0 1 2 3 4 5 6
156 63 29 8 4 1 1
檢定:這一份數據符合Poisson分佈嗎?
Goodness-of-fit test for poisson distribution
X^2 df P(> X^2)
Likelihood Ratio 25.243 5 0.00012505
它符合負二項(Negtive Binomial)分佈嗎?
Goodness-of-fit test for nbinomial distribution
X^2 df P(> X^2)
Likelihood Ratio 1.964 4 0.74238
係數:負二項(Negtive Binomial)的係數是?
$size
[1] 1.1863
$prob
[1] 0.64376
分佈:How does the distribution looks like?
機率:What is the probability that 2 <= nMay <= 6
?
💡 學習重點:離散機率的應用步驟
1. 檢定分佈的種類
2. 估計分佈的參數
3. 推論事件的機率