Density of the Poisson distribution
In this exercise you'll find the probability that a Poisson random variable will be equal to zero by simulating and using the dpois() function, which gives an exact answer.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Foundations of Probability in R
คำแนะนำการฝึกหัด
- Simulate 100,000 draws from a Poisson distribution with a mean of 2.
- Use this simulation to estimate the probability that a draw from this Poisson distribution will be 0.
- Find the exact probability that a draw from a Poisson(2) distribution is zero, using the
dpois()function.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# 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