suppressPackageStartupMessages(require(distr))Here are the functionalities in distr you will need for the exercise
Loading the package without annoying prompt:
Creating a distribution object
Let’s create a Poisson with parameter \(\lambda = 3.2\), which we will use in the following to demonstrate the functionalities in distr you will need for the exercise
distPoisson <- Pois(lambda = 3.2)Sampling from it
Here, we sample from our Poisson distribution 1 time:
r(distPoisson)(1)[1] 4
Evaluating the PMF or density
Here we compute the PMF of a poisson at the realization \(x = 4\):
d(distPoisson)(4)[1] 0.1780928