1. Learn
  2. /
  3. Courses
  4. /
  5. Fundamentals of Bayesian Data Analysis in R

Exercise

The Poisson distribution

The Poisson distribution simulates a process where the outcome is a number of occurrences per day/year/area/unit/etc. Before using it in a Bayesian model, let's explore it!

Instructions 1/4

undefined XP
    1
    2
    3
    4

The Poisson distribution has one parameter, the average number of events per unit. In R you can simulate from a Poisson distribution using rpois where lambda is the average number of occurrences:

rpois(n = 10000, lambda = 3)
  • Use the code above to simulate 10000 draws from a Poisson distribution, assign the result to x.
  • Visualize x using a histogram (hist()).