I have a data frame with 2 columns x,f that correspond to :
x : A measurement of the number of mosquitos that enter the room in a minute.
f : The number of occurrences of each number of mosquitos per minute within the set.
library(tidyverse)
x = seq(0,14,1);x
f = c(8,32,89,134,170,170,145,103,65,36,17,7,3,1,1)
df = tibble(x,f);df
Given that the x in the data frame follows Poisson distribution I have to calculate the lambda parameter :
> df%>%summarise(lambda = sum(x*f)/ sum(x))
# A tibble: 1 × 1
lambda
<dbl>
1 46.54
#or as.numeric
lam = as.numeric(df%>%summarise(lambda = sum(x*f)/ sum(x)))
> lam
[1] 46.54286
and now I have to answer in 2 questions :
1) Find the probability that 40 mosquitos that will enter the room in 20 minutes.
2) Find the probability that the number of mosquitos that will enter the room in 5 minutes will be between 20 and 25.
How can I find these probabilities for question 1 and 2?
df%>%summarise(lambda=sum(x*f)/sum(f))
$\endgroup$