The Poisson distribution

Introduction to Statistics in R

Maggie Matsui

Content Developer, DataCamp

Poisson processes

  • Events appear to happen at a certain rate, but completely at random
  • Examples
    • Number of animals adopted from an animal shelter per week
    • Number of people arriving at a restaurant per hour
    • Number of earthquakes in California per year

  Dog in animal shelter with family

Introduction to Statistics in R

Poisson distribution

  • Probability of some # of events occurring over a fixed period of time
  • Examples
    • Probability of $\ge$ 5 animals adopted from an animal shelter per week
    • Probability of 12 people arriving at a restaurant per hour
    • Probability of $\lt$ 20 earthquakes in California per year
Introduction to Statistics in R

Lambda ($\lambda$)

  • $\lambda$ = average number of events per time interval
    • Average number of adoptions per week = 8

Poisson distribution with lambda = 8

Introduction to Statistics in R

Lambda is the distribution's peak

3 Poisson distributions: one with lambda = 1, one with lambda = 5, and one with lambda = 8

Introduction to Statistics in R

Probability of a single value

If the average number of adoptions per week is 8, what is $P(\text{\# adoptions in a week} = 5)$?

dpois(5, lambda = 8)
0.09160366
Introduction to Statistics in R

Probability of less than or equal to

If the average number of adoptions per week is 8, what is $P(\text{\# adoptions in a week} \le 5)$?

ppois(5, lambda = 8)
0.1912361
Introduction to Statistics in R

Probability of greater than

If the average number of adoptions per week is 8, what is $P(\text{\# adoptions in a week} \gt 5)$?

ppois(5, lambda = 8, lower.tail = FALSE)
0.8087639

If the average number of adoptions per week is 10, what is $P(\text{\# adoptions in a week} \gt 5)$?

ppois(5, lambda = 10, lower.tail = FALSE)
0.932914
Introduction to Statistics in R

Sampling from a Poisson distribution

rpois(10, lambda = 8)
13  6 11  7 10  8  7  3  7  6
Introduction to Statistics in R

The CLT still applies!

Distribution of sample means from Poisson distribution with lambda = 8. Resembles the normal distribution

Introduction to Statistics in R

Let's practice!

Introduction to Statistics in R

Preparing Video For Download...