Poisson Functions in R Programming

Poisson Functions in R Programming, the likelihood of a certain number of events occurring in a given period of space or time if these occurrences occur at a known constant mean rate is represented by the Poisson distribution (free of the period since the ultimate event).

Siméon Denis Poisson is the name given to the Poisson distribution (French Mathematician).

Cluster Meaning-Cluster or area sampling in a nutshell » finnstats

With the help of R’s built-in functions, many probability distributions may be simply implemented.

Poisson Functions in R Programming

In R, there are four Poisson functions to choose from:

Function              Description

dpois     Poisson probability mass function (Probability function)

ppois     Poisson distribution (Cumulative distribution function)

qpois     Poisson quantile function

rpois      Poisson pseudorandom number generation

1. Poisson Probability Mass Function- dpois()

For any value of k, the R dpois function can be used to calculate the Poisson probability function with mean lambda. The arguments of the function are summarised in the code below.

Data Visualization Graphs-ggside with ggplot » finnstats

Syntax:

dpois(k,lambda, log)

where,

 k: number of successful events that happened in an interval

lambda: mean per interval

log: If TRUE then the function returns probability in form of log.

Coefficient of Variation Example » Acceptable | Not Acceptable» finnstats

dpois(2, 3)
[1] 0.2240418
dpois(6, 6)
[1] 0.1606231

2. Poisson Distribution- ppois()

The ppois function can be used to compute the probability of a variable X following a Poisson distribution with values equal to or lower than X. The arguments are listed below:

Syntax:

ppois(q, lambda, lower.tail, log)

where,

 q: number of successful events that happened in an interval

lambda: mean per interval

lower.tail: If TRUE, the left tail is taken into account; if FALSE, the right tail is taken into account.

log: If TRUE then the function returns probability in form of a log.

Types of Regression Techniques Guide » finnstats

ppois(2, 3)
 [1] 0.4231901
ppois(6, 6)
[1] 0.6063028

3. Poisson pseudorandom-rpois()

The rpois function can be used to draw q observations from a Poisson distribution. The arguments of the function are summarised in the code below.

Syntax:

rpois(q, lambda)

where,

q: number of random numbers needed

lambda: mean per interval

How to calculate Hamming Distance in R » finnstats

rpois(2, 3)
[1] 4 1
rpois(6, 6)
[1]  9  2  9  9  1 10

4. Poisson quantile function-qpois()

The associated Poisson quantiles for a collection of probabilities can be obtained using the R qpois function.

Syntax:

qpois(q, lambda, lower.tail, log)

where,

 q: number of successful events that happened in an interval

lambda: mean per interval

lower.tail: If TRUE, the left tail is taken into account; if FALSE, the right tail is taken into account.

log: If TRUE, the function returns probability as a logarithm.

Funnel Chart in R-Interactive Funnel Plot » finnstats

y <- c(.021, .053, .21, .32)
qpois(y, 2)
[1] 0 0 1 1
qpois(y, 6)
[1] 2 2 4 5

Subscribe to our newsletter!

[newsletter_form type=”minimal”]

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

2 × 3 =