開始使用免費開始

Poisson 分配的機率質量

在這個練習中,你要用模擬與 dpois() 函式(可得到精確答案)來找出 Poisson 隨機變數等於 0 的機率。

本練習屬於課程

R 的機率基礎

檢視課程

練習說明

  • 從平均數為 2 的 Poisson 分配模擬 100,000 次抽樣。
  • 用這個模擬來估計從該 Poisson 分配抽到 0 的機率。
  • 使用 dpois() 函式,計算 Poisson(2) 分配抽到 0 的精確機率。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Simulate 100,000 draws from Poisson(2)
poisson_sample <-

# Find the percentage of simulated values that are 0


# Use dpois to find the exact probability that a draw is 0
編輯並執行程式碼