Search code examples
rprobabilitypoisson

Find a probability of Poisson distribution in R


Can somebody help me how can I calculate a probability p from the Poisson equation (programming in R)? I know that there is the ppois function, but I'm not sure if I'm able to use it here somehow ... The equation:

the photo of equation


Solution

  • Perhaps you can try uniroot + ppois like below to solve p

    > (p <- uniroot(function(p) ppois(5, 650 * p) - 0.5, c(0, 1), tol = 1e-10)$root)
    [1] 0.008723325
    

    and you can verify

    > ppois(5, 650 * p)
    [1] 0.5
    

    or

    > sum(dpois(0:5, 650*p))
    [1] 0.5